From ae23e68d1214b84b44ba101c75134821c1e4081e Mon Sep 17 00:00:00 2001 From: Andreas Awouters Date: Wed, 30 Apr 2025 15:49:59 +0200 Subject: [PATCH] 130484: Filter new bundles --- .../item-bitstreams/item-bitstreams.component.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts index 52db8dccfe..6d52ef5b4a 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts @@ -198,14 +198,10 @@ export class ItemBitstreamsComponent extends AbstractItemUpdateComponent impleme */ updateBundles(newBundlesPL: PaginatedList) { const currentBundles = this.bundlesSubject.getValue(); - const bundlesToAdd: Bundle[] = []; // Only add bundles to the bundle subject if they are not present yet - newBundlesPL.page.forEach(newBundle => { - if (!currentBundles.some(currentBundle => currentBundle.id === newBundle.id)) { - bundlesToAdd.push(newBundle); - } - }); + const bundlesToAdd = newBundlesPL.page + .filter(bundleToAdd => !currentBundles.some(currentBundle => currentBundle.id === bundleToAdd.id)); const updatedBundles = [...currentBundles, ...bundlesToAdd];