Browse Source

fix(mobile): do not show trashed assets in album viewer page (#4894)

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
shenlong 1 year ago
parent
commit
c2c26c471a

+ 1 - 0
mobile/lib/modules/trash/providers/trashed_asset.provider.dart

@@ -37,6 +37,7 @@ class TrashNotifier extends StateNotifier<bool> {
           .remoteIdProperty()
           .remoteIdProperty()
           .findAll();
           .findAll();
 
 
+      // TODO: handle local asset removal on emptyTrash
       _ref
       _ref
           .read(syncServiceProvider)
           .read(syncServiceProvider)
           .handleRemoteAssetRemoval(idsToRemove.cast<String>().toList());
           .handleRemoteAssetRemoval(idsToRemove.cast<String>().toList());

+ 2 - 1
mobile/lib/shared/models/album.dart

@@ -77,7 +77,8 @@ class Album {
   }
   }
 
 
   Stream<void> watchRenderList(GroupAssetsBy groupAssetsBy) async* {
   Stream<void> watchRenderList(GroupAssetsBy groupAssetsBy) async* {
-    final query = assets.filter().sortByFileCreatedAtDesc();
+    final query =
+        assets.filter().isTrashedEqualTo(false).sortByFileCreatedAtDesc();
     _renderList = await RenderList.fromQuery(query, groupAssetsBy);
     _renderList = await RenderList.fromQuery(query, groupAssetsBy);
     yield _renderList;
     yield _renderList;
     await for (final _ in query.watchLazy()) {
     await for (final _ in query.watchLazy()) {