From 321525ead593e8b270741378cde912a5bb55bb27 Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Sat, 16 Mar 2024 14:22:15 +0100 Subject: [PATCH] fix(web): updating asset store after remove (#7999) --- web/src/lib/stores/assets.store.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index b35da65c1b..30fc06085d 100644 --- a/web/src/lib/stores/assets.store.ts +++ b/web/src/lib/stores/assets.store.ts @@ -429,7 +429,6 @@ export class AssetStore { removeAssets(ids: string[]) { const idSet = new Set(ids); - this.assets = this.assets.filter((asset) => !idSet.has(asset.id)); // Iterate in reverse to allow array splicing. for (let index = this.buckets.length - 1; index >= 0; index--) { @@ -441,16 +440,13 @@ export class AssetStore { } bucket.assets.splice(index_, 1); - bucket.bucketCount = bucket.assets.length; - if (bucket.bucketCount === 0) { + if (bucket.assets.length === 0) { this.buckets.splice(index, 1); } - - delete this.assetToBucket[asset.id]; } } - this.emit(false); + this.emit(true); } async getPreviousAssetId(assetId: string): Promise {