From 90c067997bdd3e1e3a18c7896baa6d119fcc61ba Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Thu, 7 Jan 2021 21:13:29 -0700 Subject: [PATCH] Only show Sign Out button when actually authenticated --- Xcodes/SettingsView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xcodes/SettingsView.swift b/Xcodes/SettingsView.swift index 57d9883..6a8212f 100644 --- a/Xcodes/SettingsView.swift +++ b/Xcodes/SettingsView.swift @@ -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 })