Only show Sign Out button when actually authenticated

This commit is contained in:
Brandon Evans 2021-01-07 21:13:29 -07:00
parent a0e258a937
commit 90c067997b
No known key found for this signature in database
GPG key ID: D58A4B8DB64F8E93

View file

@ -9,8 +9,8 @@ struct SettingsView: View {
VStack(alignment: .leading) {
GroupBox(label: Text("Apple ID")) {
VStack(alignment: .leading) {
if let username = Current.defaults.string(forKey: "username") {
Text(username)
if appState.authenticationState == .authenticated {
Text(Current.defaults.string(forKey: "username") ?? "-")
Button("Sign Out", action: appState.signOut)
} else {
Button("Sign In", action: { self.appState.presentingSignInAlert = true })