Explorar o código

Merge pull request #336 from ente-io/preserve_more_fix

Fix: Sync all files on disk change when limited permission is granted
Manav %!s(int64=3) %!d(string=hai) anos
pai
achega
3ea607f1c4
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      lib/services/local_sync_service.dart

+ 7 - 1
lib/services/local_sync_service.dart

@@ -275,12 +275,18 @@ class LocalSyncService {
   }
   }
 
 
   void _registerChangeCallback() {
   void _registerChangeCallback() {
+    // In case of iOS limit permission, this call back is fired immediately
+    // after file selection dialog is dismissed.
     PhotoManager.addChangeCallback((value) async {
     PhotoManager.addChangeCallback((value) async {
       _logger.info("Something changed on disk");
       _logger.info("Something changed on disk");
       if (_existingSync != null) {
       if (_existingSync != null) {
         await _existingSync.future;
         await _existingSync.future;
       }
       }
-      sync();
+      if (hasGrantedLimitedPermissions()) {
+        syncAll();
+      } else {
+        sync();
+      }
     });
     });
     PhotoManager.startChangeNotify();
     PhotoManager.startChangeNotify();
   }
   }