Marino Faggiana 7 anni fa
parent
commit
60fc985ee3
1 ha cambiato i file con 13 aggiunte e 12 eliminazioni
  1. 13 12
      PickerFileProvider/FileProvider.swift

+ 13 - 12
PickerFileProvider/FileProvider.swift

@@ -888,19 +888,20 @@ class FileProvider: NSFileProviderExtension {
             return
         }
         
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
-
-            if serverUrl == homeServerUrl {
-                NSFileProviderManager.default.signalEnumerator(for: .rootContainer, completionHandler: { (error) in
-                    print("send signal rootContainer")
+        if serverUrl == homeServerUrl {
+            NSFileProviderManager.default.signalEnumerator(for: .rootContainer, completionHandler: { (error) in
+                print("send signal rootContainer")
+            })
+        } else if serverUrl == "WorkingSet" {
+            NSFileProviderManager.default.signalEnumerator(for: .workingSet, completionHandler: { (error) in
+                print("send signal workingSet")
+            })
+        } else {
+            if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", account, serverUrl)) {
+                let itemDirectory = NSFileProviderItemIdentifier(directory.fileID)
+                NSFileProviderManager.default.signalEnumerator(for: itemDirectory, completionHandler: { (error) in
+                    print("send signal")
                 })
-            } else {
-                if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", account, serverUrl)) {
-                    let itemDirectory = NSFileProviderItemIdentifier(directory.fileID)
-                    NSFileProviderManager.default.signalEnumerator(for: itemDirectory, completionHandler: { (error) in
-                        print("send signal")
-                    })
-                }
             }
         }
     }