Skip to content

armgit / ente

Public Imported from GitHub
0

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

Return LoadingPhotosWidget result from first-import helper

Prateek Sunal5189173d5c70
diff --git a/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart b/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart
index 15e6936dc4..2bb2160603 100644
--- a/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart
+++ b/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart
@@ -57,8 +57,7 @@ Future<bool?> handleFolderSelectionBackupFlow(
bool isFirstBackup = false,
}) async {
if (_shouldRunFirstImportFlow()) {
- await _handleFirstImportFlow(context);
- return null;
+ return _handleFirstImportFlow(context);
}
return _navigateToFolderSelection(context, isFirstBackup: isFirstBackup);
@@ -68,16 +67,16 @@ bool _shouldRunFirstImportFlow() =>
flagService.enableOnlyBackupFuturePhotos &&
!LocalSyncService.instance.hasCompletedFirstImport();
-Future<void> _handleFirstImportFlow(BuildContext context) async {
+Future<bool?> _handleFirstImportFlow(BuildContext context) async {
final state = await _requestPermissions();
- if (state == null || !context.mounted) return;
+ if (state == null || !context.mounted) return null;
if (!_hasMinimalPermission(state)) {
await _showPermissionDeniedDialog(context);
- return;
+ return null;
}
- await routeToPage(
+ return routeToPage<bool>(
context,
const LoadingPhotosWidget(isOnboardingFlow: false),
);