Explorar el Código

fix main thread code

marinofaggiana hace 5 años
padre
commit
cfc015f359
Se han modificado 1 ficheros con 5 adiciones y 6 borrados
  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) {