Selaa lähdekoodia

fix main thread code

marinofaggiana 5 vuotta sitten
vanhempi
commit
cfc015f359
1 muutettua tiedostoa jossa 5 lisäystä ja 6 poistoa
  1. 5 6
      iOSClient/Main/CCMain.m

+ 5 - 6
iOSClient/Main/CCMain.m

@@ -1162,13 +1162,12 @@
         (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload];
     }
     
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
-        
-        // File is changed ??
-        if (!self.searchController.isActive && metadatasToInsertInDB)
+    // File is changed ??
+    if (!self.searchController.isActive && metadatasToInsertInDB) {
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
             [[CCSynchronize sharedSynchronize] verifyChangeMedatas:metadatasToInsertInDB serverUrl:serverUrl account:account withDownload:NO];
-    });
-    
+        });
+    }
     // Search Mode
     if (self.searchController.isActive) {