Browse Source

migrate only after first import is done

Neeraj Gupta 2 years ago
parent
commit
f7723b2bc5
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lib/services/local_sync_service.dart

+ 4 - 2
lib/services/local_sync_service.dart

@@ -149,13 +149,15 @@ class LocalSyncService {
     if (hasUpdated) {
       Bus.instance.fire(BackupFoldersUpdatedEvent());
     }
-    if (!_prefs.containsKey(hasImportedDeviceCollections)) {
+    // migrate the backed up folder settings after first import is done remove
+    // after 6 months?
+    if (!_prefs.containsKey(hasImportedDeviceCollections) &&
+        _prefs.containsKey(kHasCompletedFirstImportKey)) {
       await _migrateOldSettings(result);
     }
     return hasUpdated;
   }
 
-  // migrate the backed up folder settings. remove after 6 months?
   Future<void> _migrateOldSettings(
     List<Tuple2<AssetPathEntity, String>> result,
   ) async {