diff --git a/web/src/lib/stores/asset.store.spec.ts b/web/src/lib/stores/asset.store.spec.ts index 025362faae..3fd9e1e981 100644 --- a/web/src/lib/stores/asset.store.spec.ts +++ b/web/src/lib/stores/asset.store.spec.ts @@ -202,6 +202,15 @@ describe('AssetStore', () => { expect(updateAssetsSpy).toBeCalledWith([asset]); expect(assetStore.assets.length).toEqual(1); }); + + it('ignores trashed assets when isTrashed is true', () => { + const asset = assetFactory.build({ isTrashed: false }); + const trashedAsset = assetFactory.build({ isTrashed: true }); + + const assetStore = new AssetStore({ isTrashed: true }); + assetStore.addAssets([asset, trashedAsset]); + expect(assetStore.assets).toEqual([trashedAsset]); + }); }); describe('updateAssets', () => { diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index b1f91466b3..673ec2c780 100644 --- a/web/src/lib/stores/assets.store.ts +++ b/web/src/lib/stores/assets.store.ts @@ -326,7 +326,8 @@ export class AssetStore { this.options.personId || this.options.albumId || isMismatched(this.options.isArchived, asset.isArchived) || - isMismatched(this.options.isFavorite, asset.isFavorite) + isMismatched(this.options.isFavorite, asset.isFavorite) || + isMismatched(this.options.isTrashed, asset.isTrashed) ) { // If asset is already in the bucket we don't need to recalculate // asset store containers