From a0e258a9376d398abf9d88cd48409a24cb85d00e Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Thu, 7 Jan 2021 20:47:31 -0700 Subject: [PATCH] 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. --- Xcodes/SettingsView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xcodes/SettingsView.swift b/Xcodes/SettingsView.swift index 7b4d9b4..57d9883 100644 --- a/Xcodes/SettingsView.swift +++ b/Xcodes/SettingsView.swift @@ -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")) {