mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(web): updating asset store after remove (#7999)
This commit is contained in:
parent
1d24e20d22
commit
321525ead5
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user