Skip to content

Commit ae23e68

Browse files
committed
130484: Filter new bundles
1 parent 501ccfe commit ae23e68

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,10 @@ export class ItemBitstreamsComponent extends AbstractItemUpdateComponent impleme
198198
*/
199199
updateBundles(newBundlesPL: PaginatedList<Bundle>) {
200200
const currentBundles = this.bundlesSubject.getValue();
201-
const bundlesToAdd: Bundle[] = [];
202201

203202
// Only add bundles to the bundle subject if they are not present yet
204-
newBundlesPL.page.forEach(newBundle => {
205-
if (!currentBundles.some(currentBundle => currentBundle.id === newBundle.id)) {
206-
bundlesToAdd.push(newBundle);
207-
}
208-
});
203+
const bundlesToAdd = newBundlesPL.page
204+
.filter(bundleToAdd => !currentBundles.some(currentBundle => currentBundle.id === bundleToAdd.id));
209205

210206
const updatedBundles = [...currentBundles, ...bundlesToAdd];
211207

0 commit comments

Comments
 (0)