Skip to content

High performance self-hosted photo and video management solution.

fix(web): updating asset store after remove (#7999)

Michel Heusschen321525ead593
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<string | null> {