mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
only show signed in view if authenticated
This commit is contained in:
parent
357121bad5
commit
499d33f8e0
2 changed files with 2 additions and 7 deletions
|
|
@ -120,7 +120,7 @@ struct MainWindow: View {
|
|||
|
||||
@ViewBuilder
|
||||
private func signInView() -> some View {
|
||||
if appState.hasSavedUsername {
|
||||
if appState.authenticationState == .authenticated {
|
||||
VStack {
|
||||
SignedInView()
|
||||
.padding(32)
|
||||
|
|
|
|||
|
|
@ -7,12 +7,7 @@ struct GeneralPreferencePane: View {
|
|||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
GroupBox(label: Text("Apple ID")) {
|
||||
// If we have saved a username then we will show it here,
|
||||
// even if we don't have a valid session right now,
|
||||
// because we should be able to get a valid session if needed with the password in the keychain
|
||||
// and a 2FA code from the user.
|
||||
// Note that AppState.authenticationState is not necessarily .authenticated in this case, though.
|
||||
if appState.hasSavedUsername {
|
||||
if appState.authenticationState == .authenticated {
|
||||
SignedInView()
|
||||
} else {
|
||||
Button("Sign In", action: { self.appState.presentedSheet = .signIn })
|
||||
|
|
|
|||
Loading…
Reference in a new issue