File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/app/item-page/edit-item-page/item-bitstreams Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -249,14 +249,10 @@ export class ItemBitstreamsComponent extends AbstractItemUpdateComponent impleme
249249 */
250250 updateBundles ( newBundlesPL : PaginatedList < Bundle > ) {
251251 const currentBundles = this . bundlesSubject . getValue ( ) ;
252- const bundlesToAdd : Bundle [ ] = [ ] ;
253252
254253 // Only add bundles to the bundle subject if they are not present yet
255- newBundlesPL . page . forEach ( newBundle => {
256- if ( ! currentBundles . some ( currentBundle => currentBundle . id === newBundle . id ) ) {
257- bundlesToAdd . push ( newBundle ) ;
258- }
259- } ) ;
254+ const bundlesToAdd = newBundlesPL . page
255+ . filter ( bundleToAdd => ! currentBundles . some ( currentBundle => currentBundle . id === bundleToAdd . id ) ) ;
260256
261257 const updatedBundles = [ ...currentBundles , ...bundlesToAdd ] ;
262258
You can’t perform that action at this time.
0 commit comments