From e516de250a5b4b689e557034d235fc71ca31feab Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 18 Dec 2019 15:16:14 +0100 Subject: [PATCH] fixed profile link bug --- .../main-navigation/main-navigation.component.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/components/main-navigation/main-navigation.component.ts b/src/app/components/main-navigation/main-navigation.component.ts index 2607e3c..f97bb73 100644 --- a/src/app/components/main-navigation/main-navigation.component.ts +++ b/src/app/components/main-navigation/main-navigation.component.ts @@ -24,7 +24,7 @@ export class MainNavigationComponent implements OnInit { levellist: Levellist = new Levellist() level: string points: number - profileUrl: string + profileUrl: string = "/profile/1" lighttheme : boolean = true overlay; @@ -47,11 +47,12 @@ export class MainNavigationComponent implements OnInit { this.level = this.levellist.getLevelName(user.level) this.points = user.points this.profileUrl = '/profile/' + this.userId; + this.updateLinks(); }) } navLinksLoggedIn = [ { path: '', label: 'Home' }, - { path: 'profile/1', label: 'Profile' }, + { path: this.profileUrl, label: 'Profile' }, { path: '/about', label: 'About' }, { path: '/imprint', label: 'Imprint' }, ]; @@ -75,7 +76,15 @@ export class MainNavigationComponent implements OnInit { this.overlay.classList.add("dark-theme"); this.onSetTheme("dark-theme"); } -} + } + updateLinks(){ + this.navLinksLoggedIn = [ + { path: '', label: 'Home' }, + { path: this.profileUrl, label: 'Profile' }, + { path: '/about', label: 'About' }, + { path: '/imprint', label: 'Imprint' }, + ]; + } @HostBinding('class') componentCssClass; onSetTheme(theme) {