diff options
Diffstat (limited to 'client/src/app/menu/menu.component.ts')
-rw-r--r-- | client/src/app/menu/menu.component.ts | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts index 8fa1de326..2f7e0cf07 100644 --- a/client/src/app/menu/menu.component.ts +++ b/client/src/app/menu/menu.component.ts | |||
@@ -4,7 +4,17 @@ import { switchMap } from 'rxjs/operators' | |||
4 | import { ViewportScroller } from '@angular/common' | 4 | import { ViewportScroller } from '@angular/common' |
5 | import { Component, OnInit, ViewChild } from '@angular/core' | 5 | import { Component, OnInit, ViewChild } from '@angular/core' |
6 | import { Router } from '@angular/router' | 6 | import { Router } from '@angular/router' |
7 | import { AuthService, AuthStatus, AuthUser, MenuService, RedirectService, ScreenService, ServerService, UserService } from '@app/core' | 7 | import { |
8 | AuthService, | ||
9 | AuthStatus, | ||
10 | AuthUser, | ||
11 | MenuLink, | ||
12 | MenuService, | ||
13 | RedirectService, | ||
14 | ScreenService, | ||
15 | ServerService, | ||
16 | UserService | ||
17 | } from '@app/core' | ||
8 | import { scrollToTop } from '@app/helpers' | 18 | import { scrollToTop } from '@app/helpers' |
9 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' | 19 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' |
10 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' | 20 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' |
@@ -35,6 +45,8 @@ export class MenuComponent implements OnInit { | |||
35 | 45 | ||
36 | currentInterfaceLanguage: string | 46 | currentInterfaceLanguage: string |
37 | 47 | ||
48 | commonMenuLinks: MenuLink[] = [] | ||
49 | |||
38 | private languages: VideoConstant<string>[] = [] | 50 | private languages: VideoConstant<string>[] = [] |
39 | private serverConfig: ServerConfig | 51 | private serverConfig: ServerConfig |
40 | private routesPerRight: { [role in UserRight]?: string } = { | 52 | private routesPerRight: { [role in UserRight]?: string } = { |
@@ -80,7 +92,10 @@ export class MenuComponent implements OnInit { | |||
80 | ngOnInit () { | 92 | ngOnInit () { |
81 | this.serverConfig = this.serverService.getTmpConfig() | 93 | this.serverConfig = this.serverService.getTmpConfig() |
82 | this.serverService.getConfig() | 94 | this.serverService.getConfig() |
83 | .subscribe(config => this.serverConfig = config) | 95 | .subscribe(config => { |
96 | this.serverConfig = config | ||
97 | this.buildMenuLinks() | ||
98 | }) | ||
84 | 99 | ||
85 | this.isLoggedIn = this.authService.isLoggedIn() | 100 | this.isLoggedIn = this.authService.isLoggedIn() |
86 | if (this.isLoggedIn === true) { | 101 | if (this.isLoggedIn === true) { |
@@ -241,6 +256,10 @@ export class MenuComponent implements OnInit { | |||
241 | } | 256 | } |
242 | } | 257 | } |
243 | 258 | ||
259 | private buildMenuLinks () { | ||
260 | this.commonMenuLinks = this.menuService.buildCommonLinks(this.serverConfig) | ||
261 | } | ||
262 | |||
244 | private buildUserLanguages () { | 263 | private buildUserLanguages () { |
245 | if (!this.user) { | 264 | if (!this.user) { |
246 | this.videoLanguages = [] | 265 | this.videoLanguages = [] |