From 5885ec8e657001020729e4a93fdee584f930e2fe Mon Sep 17 00:00:00 2001 From: Atul Mehla Date: Mon, 8 May 2023 22:07:06 -0230 Subject: [PATCH] Add text notifying user that no asset is found (#2400) --- .../modules/archive/views/archive_page.dart | 24 +++++++++++-------- .../favorite/views/favorites_page.dart | 10 +++++--- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/mobile/lib/modules/archive/views/archive_page.dart b/mobile/lib/modules/archive/views/archive_page.dart index a7b13c69ca..5b8eb26fb0 100644 --- a/mobile/lib/modules/archive/views/archive_page.dart +++ b/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() + ], + ), ); } } diff --git a/mobile/lib/modules/favorite/views/favorites_page.dart b/mobile/lib/modules/favorite/views/favorites_page.dart index 3448073e7d..d4182e4698 100644 --- a/mobile/lib/modules/favorite/views/favorites_page.dart +++ b/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), + ), ); } }