Ensure calls are made via main actor to delegate in share table view data source

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-02-28 21:57:23 +08:00
parent 26d635b6fa
commit 7a40f6f728

View file

@ -157,10 +157,10 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele
@objc func tableViewSelectionDidChange(_ notification: Notification) {
guard let selectedRow = sharesTableView?.selectedRow, selectedRow >= 0 else {
uiDelegate?.hideOptions()
Task { @MainActor in uiDelegate?.hideOptions() }
return
}
let share = shares[selectedRow]
uiDelegate?.showOptions(share: share)
Task { @MainActor in uiDelegate?.showOptions(share: share) }
}
}