[JENKINS-36921] fix a bug where items were not be favorited correctly

This commit is contained in:
Cliff Meyers 2016-07-26 14:58:40 -04:00
parent f3a54bb3cd
commit 0eb274b243
1 changed files with 10 additions and 10 deletions

View File

@ -116,8 +116,7 @@ export class FavoritesList {
_updateToggledFavorite(addFavorite, pipelineOrBranch, favoritePayload) {
if (addFavorite) {
this.favorites = this.favorites.push(favoritePayload);
}
} else {
const toggledBranchHref = pipelineOrBranch._links.self.href;
// filter the list so that only favorites which didn't match the branch's href are returned
this.favorites = this.favorites.filter(fav => {
@ -128,6 +127,7 @@ export class FavoritesList {
);
});
}
}
@computed get count() {
return this.favorites && this.favorites.length || 0;