From c50685335858b9bc7ab8e0d85e4c88479d151f5e Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 18 Dec 2021 20:22:41 -0800 Subject: [PATCH] making things smoother and such with button for continuation on add basic info page --- nirvana-ios/Services/AuthSessionStore.swift | 5 ++++- nirvana-ios/Views/AddBasicInfo/AddBasicInfoView.swift | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nirvana-ios/Services/AuthSessionStore.swift b/nirvana-ios/Services/AuthSessionStore.swift index ec9b3c0..59d6069 100644 --- a/nirvana-ios/Services/AuthSessionStore.swift +++ b/nirvana-ios/Services/AuthSessionStore.swift @@ -147,7 +147,10 @@ final class AuthSessionStore: ObservableObject, SessionStore { // if we get a user back, then set this to our instance to allow UI to get published with all user details if firestoreUser != nil { - self.user = firestoreUser + // TODO: prolly useless since we never set up a background thread for the rest of this code before + DispatchQueue.main.async { + self.user = firestoreUser + } } } } diff --git a/nirvana-ios/Views/AddBasicInfo/AddBasicInfoView.swift b/nirvana-ios/Views/AddBasicInfo/AddBasicInfoView.swift index 19e30f8..a59080f 100644 --- a/nirvana-ios/Views/AddBasicInfo/AddBasicInfoView.swift +++ b/nirvana-ios/Views/AddBasicInfo/AddBasicInfoView.swift @@ -105,6 +105,11 @@ struct AddBasicInfoView: View { // button to save information Button { + if self.firstName.count == 0 || self.lastName.count == 0 { + print("do nothing...user didn't input anything...maybe show an alert") + return + } + print("saving information") // activate loading splashscreen @@ -119,12 +124,11 @@ struct AddBasicInfoView: View { .foregroundColor(Color.white) .frame(maxWidth: .infinity) .padding(.vertical, 20) - .background(NirvanaColor.teal) + .background(self.firstName.count == 0 || self.lastName.count == 0 ? Color.white.opacity(0.3) : NirvanaColor.teal) .clipShape(Capsule()) .shadow(radius:10) } - .offset(x: 0, y: self.firstName.count == 0 || self.lastName.count == 0 ? 200 : 0) - .animation(.spring()) + .animation(.default) .padding() } .frame(maxHeight: .infinity)