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.
This commit is contained in:
Edgar Story 2024-11-12 09:14:51 +00:00
parent a43bf63aab
commit cc03660576
No known key found for this signature in database
GPG key ID: E808B9DE966FFDDA

View file

@ -405,7 +405,9 @@ class AppState: ObservableObject {
// we don't have to show an error
// because the sheet will already be dismissed
} catch {
authError = error
Task { @MainActor in
authError = error
}
}
}
}
@ -418,7 +420,10 @@ class AppState: ObservableObject {
do {
return try fido2.deviceHasPin()
} catch {
authError = error
Task { @MainActor in
authError = error
}
return true
}
}