Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71530

Nav.push/setRoot not taking effect until page interaction

$
0
0

@bholub1 wrote:

My @App constructor, after platform.ready() checks SqlStorage for authentication data (oauth token data) -- if it's set, I call nav.push (or nav.setRoot) to go to the next page.. however it sits on the login screen until I click/tap on something (input field etc) and THEN navigates to the page. I feel like I must be missing some mundane detail... any thoughts?

constructor(platform: Platform, app:IonicApp, menu: MenuController, WAC:WAC) {
        platform.ready().then(() => {

            this.app = app;
            this.menu = menu;
            this.WAC = WAC;

            this.HomeTabsPage = HomeTabsPage;
            this.SettingsPage = SettingsPage;

            this.storage = new Storage(SqlStorage, {name:'wod2db'});

            let nav = this.app.getComponent('root-nav');
            this.nav = nav;
            this.storage.get('oauth').then((oauth) => {
                console.log("Are we logged in?");
                if (oauth) {
                    this.WAC.setAuthData(JSON.parse(oauth));
                    console.log("YUP. go to the home page");
                    nav.setRoot(HomeTabsPage); // nothing happens, until user interacts with page
                }
            });
        });
    }

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71530

Trending Articles