mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Delete fetchArticlesAsync method with completion handler in favor of async/await articlesForFeed method.
This commit is contained in:
@@ -1178,16 +1178,13 @@ private extension Account {
|
||||
}
|
||||
|
||||
func fetchArticlesAsync(feed: Feed, _ completion: @escaping ArticleSetResultBlock) {
|
||||
database.fetchArticlesAsync(feed.feedID) { [weak self] articleSetResult in
|
||||
Task { @MainActor [weak self] in
|
||||
switch articleSetResult {
|
||||
case .success(let articles):
|
||||
self?.validateUnreadCount(feed, articles)
|
||||
completion(.success(articles))
|
||||
case .failure(let databaseError):
|
||||
completion(.failure(databaseError))
|
||||
}
|
||||
}
|
||||
Task { @MainActor in
|
||||
do {
|
||||
let articles = try await self.articlesForFeed(feed)
|
||||
completion(.success(articles))
|
||||
} catch {
|
||||
completion(.failure(error as! DatabaseError))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,10 +140,6 @@ public typealias ArticleStatusesResultBlock = (ArticleStatusesResult) -> Void
|
||||
try await articlesTable.articlesForFeed(feedID)
|
||||
}
|
||||
|
||||
public func fetchArticlesAsync(_ feedID: String, _ completion: @escaping ArticleSetResultBlock) {
|
||||
articlesTable.fetchArticlesAsync(feedID, completion)
|
||||
}
|
||||
|
||||
public func fetchArticlesAsync(_ feedIDs: Set<String>, _ completion: @escaping ArticleSetResultBlock) {
|
||||
articlesTable.fetchArticlesAsync(feedIDs, completion)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user