[JENKINS-36921] fix a bug where items were not be favorited correctly
This commit is contained in:
parent
f3a54bb3cd
commit
0eb274b243
|
@ -116,17 +116,17 @@ 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 => {
|
||||
const favoritedBranch = fav.item;
|
||||
return !checkMatchingFavoriteUrls(
|
||||
favoritedBranch._links.self.href,
|
||||
toggledBranchHref,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
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 => {
|
||||
const favoritedBranch = fav.item;
|
||||
return !checkMatchingFavoriteUrls(
|
||||
favoritedBranch._links.self.href,
|
||||
toggledBranchHref,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@computed get count() {
|
||||
|
|
Loading…
Reference in New Issue