From c2c26c471a8a3392662d684613946a77897c7acc Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Tue, 7 Nov 2023 19:19:45 +0000 Subject: [PATCH] fix(mobile): do not show trashed assets in album viewer page (#4894) Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/modules/trash/providers/trashed_asset.provider.dart | 1 + mobile/lib/shared/models/album.dart | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile/lib/modules/trash/providers/trashed_asset.provider.dart b/mobile/lib/modules/trash/providers/trashed_asset.provider.dart index 2d85625a4..d0ad41b5f 100644 --- a/mobile/lib/modules/trash/providers/trashed_asset.provider.dart +++ b/mobile/lib/modules/trash/providers/trashed_asset.provider.dart @@ -37,6 +37,7 @@ class TrashNotifier extends StateNotifier { .remoteIdProperty() .findAll(); + // TODO: handle local asset removal on emptyTrash _ref .read(syncServiceProvider) .handleRemoteAssetRemoval(idsToRemove.cast().toList()); diff --git a/mobile/lib/shared/models/album.dart b/mobile/lib/shared/models/album.dart index f338abca3..1438e6f30 100644 --- a/mobile/lib/shared/models/album.dart +++ b/mobile/lib/shared/models/album.dart @@ -77,7 +77,8 @@ class Album { } Stream watchRenderList(GroupAssetsBy groupAssetsBy) async* { - final query = assets.filter().sortByFileCreatedAtDesc(); + final query = + assets.filter().isTrashedEqualTo(false).sortByFileCreatedAtDesc(); _renderList = await RenderList.fromQuery(query, groupAssetsBy); yield _renderList; await for (final _ in query.watchLazy()) {