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:
@@ -911,12 +911,14 @@ public enum FetchType {
|
||||
completion?(nil)
|
||||
return
|
||||
}
|
||||
database.mark(articleIDs: articleIDs, statusKey: statusKey, flag: flag) { databaseError in
|
||||
if let databaseError = databaseError {
|
||||
completion?(databaseError)
|
||||
} else {
|
||||
|
||||
Task { @MainActor in
|
||||
do {
|
||||
try await database.markArticleIDs(articleIDs, statusKey: statusKey, flag: flag)
|
||||
self.noteStatusesForArticleIDsDidChange(articleIDs: articleIDs, statusKey: statusKey, flag: flag)
|
||||
completion?(nil)
|
||||
} catch {
|
||||
completion?(error as? DatabaseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,10 +247,6 @@ public typealias ArticleStatusesResultBlock = (ArticleStatusesResult) -> Void
|
||||
try await articlesTable.markArticleIDs(articleIDs, statusKey, flag)
|
||||
}
|
||||
|
||||
public func mark(articleIDs: Set<String>, statusKey: ArticleStatus.Key, flag: Bool, completion: DatabaseCompletionBlock?) {
|
||||
articlesTable.mark(articleIDs, statusKey, flag, completion)
|
||||
}
|
||||
|
||||
/// Create statuses for specified articleIDs. For existing statuses, don’t do anything.
|
||||
/// For newly-created statuses, mark them as read and not-starred.
|
||||
public func createStatusesIfNeeded(articleIDs: Set<String>, completion: @escaping DatabaseCompletionBlock) {
|
||||
|
||||
Reference in New Issue
Block a user