Skip to content

armgit / ente

Public Imported from GitHub
0

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

mark first import complete in syncAll when device collections are synced

Prateek Sunal03e384b79cf0
diff --git a/mobile/apps/photos/lib/services/sync/local_sync_service.dart b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
index 839a7cf79e..f7b4bf0343 100644
--- a/mobile/apps/photos/lib/services/sync/local_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
@@ -223,6 +223,18 @@ class LocalSyncService {
),
);
}
+
+ // Mark first import as complete if not already done.
+ // This handles the case where syncAll() is called (e.g., for users who
+ // skipped onboarding) and device collections are populated.
+ if (!hasCompletedFirstImport()) {
+ await _prefs.setBool(kHasCompletedFirstImportKey, true);
+ if (backupPreferenceService.hasSkippedOnboardingPermission) {
+ await backupPreferenceService.setOnboardingPermissionSkipped(false);
+ }
+ _logger.info("first import marked complete via syncAll");
+ }
+
_logger.info("syncAll took ${stopwatch.elapsed.inMilliseconds}ms ");
return hasUnsyncedFiles;
}