fixed profile link bug

master
Max 5 years ago
parent 50594b5d63
commit e516de250a

@ -24,7 +24,7 @@ export class MainNavigationComponent implements OnInit {
levellist: Levellist = new Levellist() levellist: Levellist = new Levellist()
level: string level: string
points: number points: number
profileUrl: string profileUrl: string = "/profile/1"
lighttheme : boolean = true lighttheme : boolean = true
overlay; overlay;
@ -47,11 +47,12 @@ export class MainNavigationComponent implements OnInit {
this.level = this.levellist.getLevelName(user.level) this.level = this.levellist.getLevelName(user.level)
this.points = user.points this.points = user.points
this.profileUrl = '/profile/' + this.userId; this.profileUrl = '/profile/' + this.userId;
this.updateLinks();
}) })
} }
navLinksLoggedIn = [ navLinksLoggedIn = [
{ path: '', label: 'Home' }, { path: '', label: 'Home' },
{ path: 'profile/1', label: 'Profile' }, { path: this.profileUrl, label: 'Profile' },
{ path: '/about', label: 'About' }, { path: '/about', label: 'About' },
{ path: '/imprint', label: 'Imprint' }, { path: '/imprint', label: 'Imprint' },
]; ];
@ -75,7 +76,15 @@ export class MainNavigationComponent implements OnInit {
this.overlay.classList.add("dark-theme"); this.overlay.classList.add("dark-theme");
this.onSetTheme("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; @HostBinding('class') componentCssClass;
onSetTheme(theme) { onSetTheme(theme) {

Loading…
Cancel
Save