]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Only reimport entire file provider domain if there have been no recorded files when...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 1 Feb 2023 17:20:44 +0000 (18:20 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 12 May 2023 05:21:17 +0000 (13:21 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift

index 6d5c29b7383f1db4fc9cb0ffd07058d74ee9839f..9e6b8e3c72d6dfe54fa3a1f42643f2bf08d02125 100644 (file)
@@ -155,9 +155,9 @@ class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension, NKComm
 
         assert(ncAccount != nil)
 
-        if true { // TODO: only run this if we need to refresh root container and it is the first ever sync
-            // This refreshes the entire structure of the FileProvider and calls enumerateItems
-            // rather than enumerateChanges in the enumerator
+        if !NextcloudFilesDatabaseManager.shared.anyItemMetadatasForAccount(ncAccount!.ncKitAccount) {
+            // This refreshes the entire structure of the FileProvider and calls
+            // enumerateItems rather than enumerateChanges in the enumerator
             NSLog("Signalling manager for user %@ at server %@ to reimport everything", ncAccount!.username, ncAccount!.serverUrl)
             fpManager.reimportItems(below: .rootContainer, completionHandler: {_ in })
             return