diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4c4144a..ff685d0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -83,9 +83,6 @@ export class MyApp { this.nav.setRoot(LoginPage, {'scope': this.scope}); }); // this.nav.setRoot(StreamPage, {stream: timeline}); - pnut.user('me').then(res => { - this.profile = res.data as IUser; - }); } }).catch(err => { console.log('ERROR: ' + err); @@ -93,7 +90,7 @@ export class MyApp { }); } - openPage(page) { + async openPage(page) { // Reset the content nav to have just this page // we wouldn't want the back button to show in this scenario if (page.title === 'Logout') { @@ -103,6 +100,9 @@ export class MyApp { } else if (page.title === 'Settings' || page.title === 'About') { this.nav.push(page.component, page.params); } else if (page.title === 'Profile') { + await pnut.user('me').then(res => { + this.profile = res.data as IUser; + }); page.params = {user: this.profile, me: this.profile.username}; this.nav.push(page.component, page.params); } else {