Prechádzať zdrojové kódy

Merge pull request #336 from ente-io/preserve_more_fix

Fix: Sync all files on disk change when limited permission is granted
Manav 3 rokov pred
rodič
commit
3ea607f1c4
1 zmenil súbory, kde vykonal 7 pridanie a 1 odobranie
  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() {
+    // In case of iOS limit permission, this call back is fired immediately
+    // after file selection dialog is dismissed.
     PhotoManager.addChangeCallback((value) async {
       _logger.info("Something changed on disk");
       if (_existingSync != null) {
         await _existingSync.future;
       }
-      sync();
+      if (hasGrantedLimitedPermissions()) {
+        syncAll();
+      } else {
+        sync();
+      }
     });
     PhotoManager.startChangeNotify();
   }