Implement deletion functionality for share options view

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-03-05 17:50:40 +08:00
parent a4551b25c6
commit ff305ec9fc

View file

@ -124,4 +124,17 @@ class ShareOptionsView: NSView {
await dataSource?.reload()
}
}
@IBAction func delete(_ sender: Any) {
Task { @MainActor in
setAllFields(enabled: false)
deleteButton.isEnabled = false
saveButton.isEnabled = false
let error = await controller?.delete()
if let error = error, error != .success {
dataSource?.uiDelegate?.showError("Error deleting share: \(error.errorDescription)")
}
await dataSource?.reload()
}
}
}