Move credential auth error somewhere it won't disappear

When signing in, the Sign In button is not always in the view hierarchy, meaning error alerts weren't being shown until the next time the button appeared.
This commit is contained in:
Brandon Evans 2021-01-07 20:47:31 -07:00
parent a3e9101397
commit a0e258a937
No known key found for this signature in database
GPG key ID: D58A4B8DB64F8E93

View file

@ -14,13 +14,13 @@ struct SettingsView: View {
Button("Sign Out", action: appState.signOut)
} else {
Button("Sign In", action: { self.appState.presentingSignInAlert = true })
.sheet(isPresented: $appState.presentingSignInAlert) {
SignInCredentialsView(isPresented: $appState.presentingSignInAlert)
.environmentObject(appState)
}
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.sheet(isPresented: $appState.presentingSignInAlert) {
SignInCredentialsView(isPresented: $appState.presentingSignInAlert)
.environmentObject(appState)
}
}
GroupBox(label: Text("Data Source")) {