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)