Hide Splashscreen after setRoot()

Hello,

i have the following problem. Before I would like to hide splashscreen I am checking if the user is already logged in and also if the Json Web Token is Valid. If it isn’t I call the following function in “app.component.ts”, but the splashscreen isn’t hiding.

this.nav.setRoot(LoginPage, {}, {}, function() {
  this.splashScreen.hide();
})

Otherwise if I call it like this:

this.nav.setRoot(LoginPage);
this.splashScreen.hide();

it is working, but then I can see the “HomePage” (default root page) first for a short moment.

Maybe someone can help me to fix this problem.

Best greetings,
Stefan

1 Like

Couldn’t you just hide the splashscreen in ionViewDidLoad of LoginPage?

1 Like