move self profile lookup to when profile page is selected

This commit is contained in:
Morgan McMillian 2018-11-20 15:15:59 -08:00
parent 724db2aafd
commit 4261fcda94

View file

@ -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 {