mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove numerous superfluous MainActor annotations.
This commit is contained in:
@@ -87,7 +87,7 @@ enum CloudKitAccountDelegateError: LocalizedError {
|
||||
op.completionBlock = { mainThreadOperaion in
|
||||
completion()
|
||||
}
|
||||
Task { @MainActor in
|
||||
Task {
|
||||
mainThreadOperationQueue.add(op)
|
||||
}
|
||||
}
|
||||
@@ -658,7 +658,7 @@ private extension CloudKitAccountDelegate {
|
||||
|
||||
func sendNewArticlesToTheCloud(_ account: Account, _ feed: Feed) {
|
||||
|
||||
Task { @MainActor in
|
||||
Task {
|
||||
|
||||
do {
|
||||
let articles = try await account.articles(for: .feed(feed))
|
||||
@@ -786,12 +786,12 @@ private extension CloudKitAccountDelegate {
|
||||
|
||||
extension CloudKitAccountDelegate: CloudKitFeedInfoDelegate {
|
||||
|
||||
@MainActor func feedExternalID(article: Article) -> String? {
|
||||
func feedExternalID(article: Article) -> String? {
|
||||
|
||||
article.feed?.externalID
|
||||
}
|
||||
|
||||
@MainActor func feedURL(article: Article) -> String? {
|
||||
func feedURL(article: Article) -> String? {
|
||||
|
||||
article.feed?.url
|
||||
}
|
||||
@@ -799,14 +799,14 @@ extension CloudKitAccountDelegate: CloudKitFeedInfoDelegate {
|
||||
|
||||
extension CloudKitAccountDelegate: CloudKitSendStatusOperationDelegate {
|
||||
|
||||
@MainActor func cloudKitSendStatusOperation(_ : CloudKitSendStatusOperation, articlesFor articleIDs: Set<String>) async throws -> Set<Article> {
|
||||
func cloudKitSendStatusOperation(_ : CloudKitSendStatusOperation, articlesFor articleIDs: Set<String>) async throws -> Set<Article> {
|
||||
|
||||
guard let account else { return Set<Article>() }
|
||||
|
||||
return try await account.articles(articleIDs: articleIDs)
|
||||
}
|
||||
|
||||
@MainActor func cloudKitSendStatusOperation(_ : CloudKitSendStatusOperation, userDidDeleteZone: Error) {
|
||||
func cloudKitSendStatusOperation(_ : CloudKitSendStatusOperation, userDidDeleteZone: Error) {
|
||||
|
||||
// Delete feeds and folders
|
||||
|
||||
|
||||
@@ -935,7 +935,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
|
||||
extension FeedlyAccountDelegate: FeedlyAPICallerDelegate {
|
||||
|
||||
@MainActor func reauthorizeFeedlyAPICaller(_ caller: FeedlyAPICaller) async -> Bool {
|
||||
func reauthorizeFeedlyAPICaller(_ caller: FeedlyAPICaller) async -> Bool {
|
||||
|
||||
guard let account else {
|
||||
return false
|
||||
@@ -1006,7 +1006,7 @@ public enum FeedlyOAuthAccountAuthorizationOperationError: LocalizedError {
|
||||
self.oauthClient = FeedlyAPICaller.API.cloud.oauthAuthorizationClient(secretsProvider: secretsProvider)
|
||||
}
|
||||
|
||||
@MainActor public func run() {
|
||||
public func run() {
|
||||
assert(presentationAnchor != nil, "\(self) outlived presentation anchor.")
|
||||
|
||||
let request = FeedlyAPICaller.oauthAuthorizationCodeGrantRequest(secretsProvider: secretsProvider)
|
||||
@@ -1057,7 +1057,7 @@ public enum FeedlyOAuthAccountAuthorizationOperationError: LocalizedError {
|
||||
|
||||
private func didEndAuthentication(url: URL?, error: Error?) {
|
||||
|
||||
Task { @MainActor in
|
||||
Task {
|
||||
guard !isCanceled else {
|
||||
didFinish()
|
||||
return
|
||||
@@ -1085,7 +1085,7 @@ public enum FeedlyOAuthAccountAuthorizationOperationError: LocalizedError {
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor private func saveAccount(for grant: OAuthAuthorizationGrant) {
|
||||
private func saveAccount(for grant: OAuthAuthorizationGrant) {
|
||||
guard !AccountManager.shared.duplicateServiceAccount(type: .feedly, username: grant.accessToken.username) else {
|
||||
didFinish(FeedlyOAuthAccountAuthorizationOperationError.duplicateAccount)
|
||||
return
|
||||
@@ -1112,12 +1112,12 @@ public enum FeedlyOAuthAccountAuthorizationOperationError: LocalizedError {
|
||||
|
||||
// MARK: Managing Operation State
|
||||
|
||||
@MainActor private func didFinish() {
|
||||
private func didFinish() {
|
||||
assert(Thread.isMainThread)
|
||||
// operationDelegate?.operationDidComplete(self)
|
||||
}
|
||||
|
||||
@MainActor private func didFinish(_ error: Error) {
|
||||
private func didFinish(_ error: Error) {
|
||||
assert(Thread.isMainThread)
|
||||
delegate?.oauthAccountAuthorizationOperation(self, didFailWith: error)
|
||||
didFinish()
|
||||
|
||||
@@ -17,19 +17,19 @@ import Core
|
||||
private let fileURL: URL
|
||||
private let account: Account
|
||||
|
||||
@MainActor private var isDirty = false {
|
||||
private var isDirty = false {
|
||||
didSet {
|
||||
queueSaveToDiskIfNeeded()
|
||||
}
|
||||
}
|
||||
@MainActor private let saveQueue = CoalescingQueue(name: "Save Queue", interval: 0.5)
|
||||
private let saveQueue = CoalescingQueue(name: "Save Queue", interval: 0.5)
|
||||
|
||||
init(filename: String, account: Account) {
|
||||
self.fileURL = URL(fileURLWithPath: filename)
|
||||
self.account = account
|
||||
}
|
||||
|
||||
@MainActor func markAsDirty() {
|
||||
func markAsDirty() {
|
||||
isDirty = true
|
||||
}
|
||||
|
||||
@@ -61,11 +61,11 @@ import Core
|
||||
|
||||
private extension FeedMetadataFile {
|
||||
|
||||
@MainActor func queueSaveToDiskIfNeeded() {
|
||||
func queueSaveToDiskIfNeeded() {
|
||||
saveQueue.add(self, #selector(saveToDiskIfNeeded))
|
||||
}
|
||||
|
||||
@MainActor @objc func saveToDiskIfNeeded() {
|
||||
@objc func saveToDiskIfNeeded() {
|
||||
if isDirty {
|
||||
isDirty = false
|
||||
save()
|
||||
|
||||
Reference in New Issue
Block a user