From 4dbfbc3d96651e7d4ad0d3d344390707085bf2fc Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 31 Jul 2024 16:55:24 +0800 Subject: [PATCH] Fix file lock server url in lockviewcontroller Signed-off-by: Claudio Cambra --- .../Locking/LockViewController.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift index 3acbfcf17..af24b5ea5 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift @@ -142,7 +142,6 @@ class LockViewController: NSViewController { return } let serverPathString = serverPath as String - let itemServerRelativePath = serverPathString let kit = NextcloudKit() kit.setup( user: account.username, @@ -173,10 +172,18 @@ class LockViewController: NSViewController { descriptionLabel.stringValue = "Communicating with server, \(locking ? "locking" : "unlocking") fileā€¦" - + + let serverUrlFileName = itemMetadata.serverUrl + "/" + itemMetadata.fileName + Logger.lockViewController.info( + """ + Locking file: \(serverUrlFileName, privacy: .public) + \(self.locking ? "locking" : "unlocking", privacy: .public) + """ + ) + let error = await withCheckedContinuation { continuation in kit.lockUnlockFile( - serverUrlFileName: itemServerRelativePath, + serverUrlFileName: serverUrlFileName, shouldLock: locking, completion: { _, error in continuation.resume(returning: error)