I'm using Firebase for authentication in my app. See below for code. Currently, because of how my app loads, if a user is already logged in, then what ends up happening is that they see a flicker of the SignUpView() before going to the AppMainView. I'm guessing this is because it takes time for session to load and register that the user is logged in already. How can I avoid this flicker? Thanks!
struct ContentView: View {
@EnvironmentObject var session: SessionStore
var body: some View {
Group {
if (session.session != nil) {
AppMainView()
} else {
SignUpView()
}
}
.onAppear(perform: getUser)
}
}