File tree Expand file tree Collapse file tree
src/app/item-page/edit-item-page/item-bitstreams Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments