Skip to content

Commit a14168a

Browse files
authored
WEBDEV-7386 Distinguish favorited searches from items in removal requests (#440)
* Distinguish favorited searches from items in removal requests * Slightly simplify condition
1 parent 2a1e013 commit a14168a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/collection-browser.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,12 @@ export class CollectionBrowser
815815
this.dispatchEvent(
816816
new CustomEvent<{ items: string[] }>('itemRemovalRequested', {
817817
detail: {
818-
items: this.dataSource.checkedTileModels.map(model =>
819-
model?.identifier ? model.identifier : '',
820-
),
818+
items: this.dataSource.checkedTileModels.map(model => {
819+
// For favorited searches, we attach a search: prefix to differentiate it from an item
820+
const searchPrefix = model?.mediatype === 'search' ? 'search:' : '';
821+
const identifier = model?.identifier ?? '';
822+
return `${searchPrefix}${identifier}`;
823+
}),
821824
},
822825
}),
823826
);

0 commit comments

Comments
 (0)