зеркало из https://github.com/nextcloud/desktop.git
Add sharee fetcher method to shareesuggestionsdatasource
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Родитель
74cea5e57a
Коммит
3012976d9b
|
@ -13,6 +13,7 @@ extension Logger {
|
|||
static let actionViewController = Logger(subsystem: subsystem, category: "actionViewController")
|
||||
static let shareCapabilities = Logger(subsystem: subsystem, category: "shareCapabilities")
|
||||
static let shareController = Logger(subsystem: subsystem, category: "shareController")
|
||||
static let shareeDataSource = Logger(subsystem: subsystem, category: "shareeDataSource")
|
||||
static let sharesDataSource = Logger(subsystem: subsystem, category: "sharesDataSource")
|
||||
static let shareOptionsView = Logger(subsystem: subsystem, category: "shareOptionsView")
|
||||
static let shareViewController = Logger(subsystem: subsystem, category: "shareViewController")
|
||||
|
|
|
@ -18,4 +18,23 @@ class ShareeSuggestionsDataSource: SuggestionsDataSource {
|
|||
init(kit: NextcloudKit) {
|
||||
self.kit = kit
|
||||
}
|
||||
|
||||
private func fetchSharees(search: String) async -> [NKSharee] {
|
||||
return await withCheckedContinuation { continuation in
|
||||
kit.searchSharees(
|
||||
search: inputString,
|
||||
page: 1,
|
||||
perPage: 20,
|
||||
completion: { account, sharees, data, error in
|
||||
defer { continuation.resume(returning: sharees ?? []) }
|
||||
guard error == .success else {
|
||||
Logger.shareeDataSource.error(
|
||||
"Error fetching sharees: \(error.description, privacy: .public)"
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче