From 4261fcda949e1ea04931527750823835934626fe Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Tue, 20 Nov 2018 15:15:59 -0800 Subject: [PATCH] move self profile lookup to when profile page is selected --- src/app/app.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 {