Skip to content

Commit 6be7c6c

Browse files
committed
Fix main thread safety in iOS impl
1 parent 983e832 commit 6be7c6c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tasks-app-ios/Taskfolio/IOSGoogleAuthenticator.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import TasksAppShared
22
import GoogleSignIn
33
import UIKit
44

5+
@MainActor
56
class IOSGoogleAuthenticator: OauthGoogleAuthenticator {
67

78
func authorize(scopes: [OauthGoogleAuthenticatorScope], force: Bool, requestUserAuthorization: @escaping (Any) -> Void) async throws -> String {
89
let stringScopes = scopes.compactMap { $0.value }
910

10-
guard let windowScene = await UIApplication.shared.connectedScenes.first as? UIWindowScene,
11-
let window = await windowScene.windows.first,
12-
let rootViewController = await window.rootViewController else {
11+
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
12+
let window = windowScene.windows.first,
13+
let rootViewController = window.rootViewController else {
1314
throw GoogleSignInError.noRootViewController
1415
}
1516

0 commit comments

Comments
 (0)