Do not bother fetching shares if sharing is disabled on server
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 18 Mar 2024 10:06:56 +0000 (18:06 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 17 Apr 2024 08:39:00 +0000 (16:39 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableViewDataSource.swift

index 22faba216c1b22b9af1f85d950cc2d42fa0e2529..548f3aa94d19093b1cf8f6c6f95626e6ab0ef59e 100644 (file)
@@ -83,6 +83,12 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele
             account = convertedAccount
             await sharesTableView?.deselectAll(self)
             shareCapabilities = await fetchCapabilities()
+            guard shareCapabilities.apiEnabled else {
+                let errorMsg = "Server does not support shares."
+                Logger.sharesDataSource.info("\(errorMsg)")
+                uiDelegate?.showError(errorMsg)
+                return
+            }
             shares = await fetch(
                 itemIdentifier: itemIdentifier, itemRelativePath: serverPath as String
             )