diff --git a/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift b/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift index 35e703a88..f8bf1d82f 100644 --- a/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift +++ b/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift @@ -119,7 +119,7 @@ private extension CloudKitSendStatusOperation { return CloudKitArticleStatusUpdate(articleID: key, statuses: value, article: articlesDict[key]) } - @Sendable func done(_ stop: Bool) { + @MainActor func done(_ stop: Bool) { // Don't clear the last one since we might have had additional ticks added if self.showProgress && self.refreshProgress?.numberRemaining ?? 0 > 1 { self.refreshProgress?.completeTask() diff --git a/Account/Sources/Account/CombinedRefreshProgress.swift b/Account/Sources/Account/CombinedRefreshProgress.swift index 6f3044ce4..30a5f503b 100644 --- a/Account/Sources/Account/CombinedRefreshProgress.swift +++ b/Account/Sources/Account/CombinedRefreshProgress.swift @@ -12,7 +12,7 @@ import Web // Combines the refresh progress of multiple accounts into one struct, // for use by refresh status view and so on. -public struct CombinedRefreshProgress { +@MainActor public struct CombinedRefreshProgress { public let numberOfTasks: Int public let numberRemaining: Int diff --git a/Web/Sources/Web/DownloadProgress.swift b/Web/Sources/Web/DownloadProgress.swift index 84bfffedf..758692566 100755 --- a/Web/Sources/Web/DownloadProgress.swift +++ b/Web/Sources/Web/DownloadProgress.swift @@ -8,14 +8,12 @@ import Foundation -// Main thread only. - public extension Notification.Name { static let DownloadProgressDidChange = Notification.Name(rawValue: "DownloadProgressDidChange") } -public final class DownloadProgress { +@MainActor public final class DownloadProgress { public var numberOfTasks = 0 { didSet { @@ -94,9 +92,9 @@ public final class DownloadProgress { // MARK: - Private private extension DownloadProgress { - + func postDidChangeNotification() { - DispatchQueue.main.async { + Task { @MainActor in NotificationCenter.default.post(name: .DownloadProgressDidChange, object: self) } }