1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

fix(web): prevent new uploads from temporarily showing in trash (#10348)

This commit is contained in:
Michel Heusschen 2024-06-15 19:44:18 +02:00 committed by GitHub
parent aea1c46bea
commit dfad4f0ff4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -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', () => {

View file

@ -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