hello. i use some ignite stuff in an app i develop. i have the loginredux and loginsaga similar to the base ignite app. i have an if isLoggedIn to show the login screen otherwise show another screen. i log in in the beginning, then close the app. next time i open it, i get the login screen for a few milliseconds and then it jumps to the main screen. i console logged some stuff, and it seems like the login data is loaded but a bit later than the first render. how can i fix that? how can i get more info about it?
while I do not know specifically in the context of ignite, the traditional way to solve this problem is to render a loading state until persistence has completed. You can do this either by
persistStore(store, config, () => {
store.dispatch({ type: BOOTSTRAP_COMPLETE })
})
// in some reducer
case BOOTSTRAP_COMPLETE:
return {...state, boostraped: true}
then show a loading state until sate.boostraped === true
aha. i will try both and see. thanks :)
ok i did the first thing you suggested and it worked. should i maybe make a pr to include this in the startup redux part of ignite?
ok i actually made a pr. it was small enough to do it quickly today.
see #582 and #715 .
Most helpful comment
while I do not know specifically in the context of ignite, the traditional way to solve this problem is to render a loading state until persistence has completed. You can do this either by
then show a loading state until sate.boostraped === true