When the user opens up the app if there is already a session object then the app should open up the tabs page instead of the signup.
Whats the best way to achieve this. I am using the ionic-start-super template. https://github.com/ionic-team/ionic-starter-super
I was thinking to just check if a session exists in the constructor of the signup page, if it does then it will set the tabs page to be the root like below.
this.storage.get('user').then((user) => {
this.user = user;
if (this.user) {
this.navCtrl.setRoot(TabsPage);
}
});
Im wondering if there is a more efficient way.
you can use your script inside of
ionViewCanEnter()
like this -