[JENKINS-36921] fix a bug where items were not be favorited correctly
This commit is contained in:
parent
f3a54bb3cd
commit
0eb274b243
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue