Skip to content

Commit cc03660

Browse files
Push the setting of authError to happen on MainActor
- The Xcode “Run Time Issue” breakpoint was being hit whenever an error was being set, complaining about this being set outside of the main thread.
1 parent a43bf63 commit cc03660

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Xcodes/Backend/AppState.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ class AppState: ObservableObject {
405405
// we don't have to show an error
406406
// because the sheet will already be dismissed
407407
} catch {
408-
authError = error
408+
Task { @MainActor in
409+
authError = error
410+
}
409411
}
410412
}
411413
}
@@ -418,7 +420,10 @@ class AppState: ObservableObject {
418420
do {
419421
return try fido2.deviceHasPin()
420422
} catch {
421-
authError = error
423+
Task { @MainActor in
424+
authError = error
425+
}
426+
422427
return true
423428
}
424429
}

0 commit comments

Comments
 (0)