Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[locker] Show loading indicator until initial data load completes

AmanRajSinghMouryabf6d693a9919
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index a6301d6682..718731a8be 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -188,6 +188,7 @@ class _HomePageState extends UploaderPageState<HomePage>
final scaffoldKey = GlobalKey<ScaffoldState>();
final _searchFocusNode = FocusNode();
bool _isLoading = true;
+ bool _hasCompletedInitialLoad = false;
bool _isSettingsOpen = false;
List<Collection> _collections = [];
@@ -477,6 +478,7 @@ class _HomePageState extends UploaderPageState<HomePage>
_filteredCollections = _filterOutUncategorized(sortedCollections);
_filteredFiles = _recentFiles;
_isLoading = false;
+ _hasCompletedInitialLoad = true;
});
}
} catch (error) {
@@ -484,6 +486,7 @@ class _HomePageState extends UploaderPageState<HomePage>
setState(() {
_error = 'Error fetching collections: $error';
_isLoading = false;
+ _hasCompletedInitialLoad = true;
});
}
}
@@ -611,7 +614,7 @@ class _HomePageState extends UploaderPageState<HomePage>
}
Widget _buildBody() {
- if (_isLoading) {
+ if (_isLoading || !_hasCompletedInitialLoad) {
return const Center(
child: CircularProgressIndicator(),
);