tatsuyamoriguchi / Sleep-Tracer

1 stars 0 forks source link

When pressing the Login button with correct credentials, the app momentarily shows a modal sheet before transitioning to ContentView(). #61

Closed tatsuyamoriguchi closed 1 month ago

tatsuyamoriguchi commented 1 month ago

Find a button's modifier to display another view, instead of .sheet.

tatsuyamoriguchi commented 1 month ago

added

@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode> to Login()
                Button("Login") {
                    if authManager.login(email: email, password: password) == false {
                        message = "Wrong eMail address or password"
                    } else {
                        presentationMode.wrappedValue.dismiss()
                    }
                }
                .foregroundStyle(Color("Button Color"))