Forráskód Böngészése

Add text notifying user that no asset is found (#2400)

Atul Mehla 2 éve
szülő
commit
5885ec8e65

+ 14 - 10
mobile/lib/modules/archive/views/archive_page.dart

@@ -111,16 +111,20 @@ class ArchivePage extends HookConsumerWidget {
 
     return Scaffold(
       appBar: buildAppBar(),
-      body: Stack(
-        children: [
-          ImmichAssetGrid(
-            assets: archivedAssets.value,
-            listener: selectionListener,
-            selectionActive: selectionEnabledHook.value,
-          ),
-          if (selectionEnabledHook.value) buildBottomBar()
-        ],
-      ),
+      body: archivedAssets.value.isEmpty
+          ? const Center(
+              child: Text('No archived assets found.'),
+            )
+          : Stack(
+              children: [
+                ImmichAssetGrid(
+                  assets: archivedAssets.value,
+                  listener: selectionListener,
+                  selectionActive: selectionEnabledHook.value,
+                ),
+                if (selectionEnabledHook.value) buildBottomBar()
+              ],
+            ),
     );
   }
 }

+ 7 - 3
mobile/lib/modules/favorite/views/favorites_page.dart

@@ -26,9 +26,13 @@ class FavoritesPage extends HookConsumerWidget {
 
     return Scaffold(
       appBar: buildAppBar(),
-      body: ImmichAssetGrid(
-        assets: ref.watch(favoriteAssetProvider),
-      ),
+      body: ref.watch(favoriteAssetProvider).isEmpty
+          ? const Center(
+              child: Text('No favorite assets found.'),
+            )
+          : ImmichAssetGrid(
+              assets: ref.watch(favoriteAssetProvider),
+            ),
     );
   }
 }