瀏覽代碼

fix main thread code

marinofaggiana 5 年之前
父節點
當前提交
cfc015f359
共有 1 個文件被更改,包括 5 次插入6 次删除
  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) {