Skip to content

Commit

Permalink
Ensure a couple of Task run on the main thread via @MainActor
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Mar 9, 2023
1 parent 3c49abd commit 76fd3c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extension ViewController {
// Note that this method does not try to authenticate the user with the WordPress backend.
// It only verifies that we can get a token from Google.
func getAuthTokenFromGoogle() {
Task {
Task { @MainActor in
do {
let token = try await self.googleAuthenticator.getOAuthToken()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class GoogleAuthenticator: NSObject {
return
}

Task {
Task { @MainActor in
do {
let token = try await requestAuthorization(
for: authType,
Expand Down

0 comments on commit 76fd3c4

Please sign in to comment.