mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Continue converting ArticlesDatabase to async/await.
This commit is contained in:
@@ -1221,7 +1221,21 @@ private extension Account {
|
||||
}
|
||||
|
||||
func fetchArticlesMatchingAsync(_ searchString: String, _ completion: @escaping ArticleSetResultBlock) {
|
||||
database.fetchArticlesMatchingAsync(searchString, flattenedFeeds().feedIDs(), completion)
|
||||
Task { @MainActor in
|
||||
|
||||
let feedIDs = flattenedFeeds().feedIDs()
|
||||
|
||||
do {
|
||||
let articles = try await database.articlesForSearchStringInFeeds(searchString, feedIDs)
|
||||
Task { @MainActor in
|
||||
completion(.success(articles))
|
||||
}
|
||||
} catch {
|
||||
Task { @MainActor in
|
||||
completion(.failure(error as! DatabaseError))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func fetchArticlesMatchingWithArticleIDsAsync(_ searchString: String, _ articleIDs: Set<String>, _ completion: @escaping ArticleSetResultBlock) {
|
||||
|
||||
Reference in New Issue
Block a user