mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 08:42:51 +00:00
Create async wrapper for update(feed, parsedFeed) method.
This commit is contained in:
1 parent
3ff09d71cc
commit
cf9a0966ae
1 file changed
+13
@@ -716,6 +716,19 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||
webFeedDictionariesNeedUpdate = true
|
||||
}
|
||||
|
||||
@MainActor func update(_ feed: WebFeed, with parsedFeed: ParsedFeed) async throws -> ArticleChanges {
|
||||
try await withCheckedThrowingContinuation { continuation in
|
||||
update(feed, with: parsedFeed) { result in
|
||||
switch result {
|
||||
case .success(let articleChanges):
|
||||
continuation.resume(returning: articleChanges)
|
||||
case .failure(let error):
|
||||
continuation.resume(throwing: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func update(_ webFeed: WebFeed, with parsedFeed: ParsedFeed, _ completion: @escaping UpdateArticlesCompletionBlock) {
|
||||
// Used only by an On My Mac or iCloud account.
|
||||
precondition(Thread.isMainThread)
|
||||
|
||||
Reference in new issue
Block a user