Make sure not to check for kit before we should in shares table view data source

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-31 15:33:08 +08:00 committed by Matthieu Gallien
parent 7ae9f833aa
commit f3e341c860

View file

@ -70,10 +70,6 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele
presentError("No item URL, cannot reload data!")
return
}
guard let kit else {
presentError("NextcloudKit instance is unavailable, cannot reload data!")
return
}
guard let itemIdentifier = await withCheckedContinuation({
(continuation: CheckedContinuation<NSFileProviderItemIdentifier?, Never>) -> Void in
NSFileProviderManager.getIdentifierForUserVisibleFile(
@ -113,6 +109,10 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele
presentError("Server does not support shares.")
return
}
guard let kit else {
presentError("NextcloudKit instance is unavailable, cannot reload data!")
return
}
itemMetadata = await fetchItemMetadata(itemRelativePath: serverPathString, kit: kit)
guard itemMetadata?.permissions.contains("R") == true else {
presentError("This file cannot be shared.")