mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Delete no-longer-used fetchStarredAndUnreadCount completion block version.
This commit is contained in:
@@ -14,9 +14,6 @@ import Articles
|
||||
// This file exists for compatibility — it provides nonisolated functions and callback-based APIs.
|
||||
// It will go away as we adopt structured concurrency.
|
||||
|
||||
public typealias SingleUnreadCountResult = Result<Int, DatabaseError>
|
||||
public typealias SingleUnreadCountCompletionBlock = @Sendable (SingleUnreadCountResult) -> Void
|
||||
|
||||
public typealias UpdateArticlesResult = Result<ArticleChanges, DatabaseError>
|
||||
public typealias UpdateArticlesCompletionBlock = @Sendable (UpdateArticlesResult) -> Void
|
||||
|
||||
@@ -31,20 +28,6 @@ public typealias ArticleStatusesResultBlock = (ArticleStatusesResult) -> Void
|
||||
|
||||
public extension ArticlesDatabase {
|
||||
|
||||
// MARK: - Unread Counts
|
||||
|
||||
nonisolated func fetchStarredAndUnreadCount(for feedIDs: Set<String>, completion: @escaping SingleUnreadCountCompletionBlock) {
|
||||
|
||||
Task {
|
||||
do {
|
||||
let unreadCount = try await starredAndUnreadCount(feedIDs: feedIDs)!
|
||||
callSingleUnreadCountCompletion(completion, .success(unreadCount))
|
||||
} catch {
|
||||
callSingleUnreadCountCompletion(completion, .failure(.suspended))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Saving, Updating, and Deleting Articles
|
||||
|
||||
/// Update articles and save new ones — for feed-based systems (local and iCloud).
|
||||
@@ -165,13 +148,6 @@ public extension ArticlesDatabase {
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated private func callSingleUnreadCountCompletion(_ completion: @escaping SingleUnreadCountCompletionBlock, _ result: SingleUnreadCountResult) {
|
||||
|
||||
Task { @MainActor in
|
||||
completion(result)
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated private func callUpdateArticlesCompletion(_ completion: @escaping UpdateArticlesCompletionBlock, _ result: UpdateArticlesResult) {
|
||||
|
||||
Task { @MainActor in
|
||||
|
||||
Reference in New Issue
Block a user