Skip to content

Commit 415f029

Browse files
committed
Update WordPress site info fetching task to run on main thread
1 parent 41756a5 commit 415f029

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Yosemite/Yosemite/Stores/WordPressSiteStore.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@ public final class WordPressSiteStore: DeauthenticatedStore {
3737

3838
private extension WordPressSiteStore {
3939
func fetchSiteInfo(for siteURL: String, completion: @escaping (Result<Site, Error>) -> Void) {
40-
Task {
40+
Task { @MainActor in
4141
do {
4242
let wpSite = try await remote.fetchSiteInfo(for: siteURL)
4343
let site = wpSite.asSite
44-
await MainActor.run {
45-
completion(.success(site))
46-
}
44+
completion(.success(site))
4745
} catch {
48-
await MainActor.run {
49-
completion(.failure(error))
50-
}
46+
completion(.failure(error))
5147
}
5248
}
5349
}

0 commit comments

Comments
 (0)