]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Run post-auth state check with main actor task
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 15 Oct 2024 06:21:03 +0000 (14:21 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 18 Oct 2024 06:16:25 +0000 (14:16 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension+ClientInterface.swift

index 98a9cb250f2ef92d05c7b62615a9d50807a27681..2a7e5d8e51489bdcc5e2dc20bc3656474201708e 100644 (file)
@@ -145,25 +145,27 @@ extension FileProviderExtension: NSFileProviderServicing, ChangeNotificationInte
                 )
             }
 
-            let newNcAccount =
-                Account(user: user, id: userId, serverUrl: serverUrl, password: password)
-            guard newNcAccount != ncAccount else { return }
-            ncAccount = newNcAccount
-            ncKit.setup(
-                account: newNcAccount.ncKitAccount,
-                user: newNcAccount.username,
-                userId: newNcAccount.id,
-                password: newNcAccount.password,
-                urlBase: newNcAccount.serverUrl,
-                userAgent: "Nextcloud-macOS/FileProviderExt",
-                nextcloudVersion: 25,
-                delegate: nil) // TODO: add delegate methods for self
-
-            changeObserver = RemoteChangeObserver(
-                remoteInterface: ncKit, changeNotificationInterface: self, domain: domain
-            )
-            ncKit.setup(delegate: changeObserver)
-            signalEnumeratorAfterAccountSetup()
+            Task { @MainActor in
+                let newNcAccount =
+                    Account(user: user, id: userId, serverUrl: serverUrl, password: password)
+                guard newNcAccount != ncAccount else { return }
+                ncAccount = newNcAccount
+                ncKit.setup(
+                    account: newNcAccount.ncKitAccount,
+                    user: newNcAccount.username,
+                    userId: newNcAccount.id,
+                    password: newNcAccount.password,
+                    urlBase: newNcAccount.serverUrl,
+                    userAgent: "Nextcloud-macOS/FileProviderExt",
+                    nextcloudVersion: 25,
+                    delegate: nil) // TODO: add delegate methods for self
+                
+                changeObserver = RemoteChangeObserver(
+                    remoteInterface: ncKit, changeNotificationInterface: self, domain: domain
+                )
+                ncKit.setup(delegate: changeObserver)
+                signalEnumeratorAfterAccountSetup()
+            }
         }
     }