From 6228a69b4b3354b65a0881d85b159fa06a7198ba Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Tue, 24 Nov 2020 09:32:23 +0100 Subject: [PATCH] fixed sidenav Fixed the sidenav not displaying the current logged in user on the first load of the side --- .../sidenav-profile/sidenav-profile.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/components/sidenav-profile/sidenav-profile.component.ts b/src/app/components/sidenav-profile/sidenav-profile.component.ts index d4d6a7f..d1d74cf 100644 --- a/src/app/components/sidenav-profile/sidenav-profile.component.ts +++ b/src/app/components/sidenav-profile/sidenav-profile.component.ts @@ -15,9 +15,12 @@ export class SidenavProfileComponent implements OnInit { ngOnInit() { this.auth.currentUser.subscribe(user => { - this.name = user.user.name; - this.email = user.user.email; - this.profileURL = user.user.attributes.profile_url; + console.log("change " + JSON.stringify(user)); + if (user !== null){ + this.name = user.user.name; + this.email = user.user.email; + this.profileURL = user.user.attributes.profile_url; + } }); } } \ No newline at end of file