Instantiate share data source in share view controller

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-02-27 20:29:07 +08:00
parent 1288448336
commit 46ad6f0bfb

View file

@ -11,6 +11,7 @@ import OSLog
import QuickLookThumbnailing import QuickLookThumbnailing
class ShareViewController: NSViewController { class ShareViewController: NSViewController {
let shareDataSource = ShareTableViewDataSource()
let itemIdentifiers: [NSFileProviderItemIdentifier] let itemIdentifiers: [NSFileProviderItemIdentifier]
@IBOutlet weak var fileNameIcon: NSImageView! @IBOutlet weak var fileNameIcon: NSImageView!
@ -58,6 +59,8 @@ class ShareViewController: NSViewController {
do { do {
let itemUrl = try await manager.getUserVisibleURL(for: itemIdentifier) let itemUrl = try await manager.getUserVisibleURL(for: itemIdentifier)
await updateDisplay(itemUrl: itemUrl) await updateDisplay(itemUrl: itemUrl)
shareDataSource.sharesTableView = tableView
shareDataSource.loadItem(identifier: itemIdentifier, url: itemUrl)
} catch let error { } catch let error {
let errorString = "Error processing item: \(error)" let errorString = "Error processing item: \(error)"
Logger.shareViewController.error("\(errorString)") Logger.shareViewController.error("\(errorString)")