Dismiss initial view does not work as expected

When my app launches, I load a user token from local storage and check its validity inside the Global Canvas, and if the token is still valid, dismiss the initial view, which is a Login screen. The app should then transition to my Main page automatically as the user is still logged in.

However, what actually happens is that the initial view page is still mounted, and I still see the Login screen briefly before finally moving to the Main page. How can I prevent the Login screen from showing in this case?

I’m using Preview App, and the issue happens in both Android and iOS.

Hi, the initial view will be shown as long as it’s not dismissed, so if your request to check the token validity takes a while, the login screen will be shown for a brief moment. I’ve found that in released apps with this kind of logic the dismissal seems to happen faster than in the preview app since there is also a splash screen in the beginning, although there might be a barely noticeable flash of the login screen.

Thanks @Mari! I ended up not hiding the spinner in the login screen and doing it in the main screen unless the token wasn’t valid. Would the spinner be replaced by the splash screen instead once the app is built?