From cf9a0966aea7ee61c692dccb7ff45be93bb1f0b3 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 17 Oct 2025 22:38:06 -0700 Subject: [PATCH] Create async wrapper for update(feed, parsedFeed) method. --- Modules/Account/Sources/Account/Account.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Modules/Account/Sources/Account/Account.swift b/Modules/Account/Sources/Account/Account.swift index 28df121f2..a83862f6e 100644 --- a/Modules/Account/Sources/Account/Account.swift +++ b/Modules/Account/Sources/Account/Account.swift @@ -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)