diff options
Diffstat (limited to 'client/src/app/+my-account/my-account.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account.component.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/client/src/app/+my-account/my-account.component.ts b/client/src/app/+my-account/my-account.component.ts index d98d06f8e..05dcf522d 100644 --- a/client/src/app/+my-account/my-account.component.ts +++ b/client/src/app/+my-account/my-account.component.ts | |||
@@ -1,20 +1,28 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ServerService } from '@app/core' | 2 | import { ServerService } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component' | 4 | import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component' |
5 | import { ServerConfig } from '@shared/models' | ||
5 | 6 | ||
6 | @Component({ | 7 | @Component({ |
7 | selector: 'my-my-account', | 8 | selector: 'my-my-account', |
8 | templateUrl: './my-account.component.html', | 9 | templateUrl: './my-account.component.html', |
9 | styleUrls: [ './my-account.component.scss' ] | 10 | styleUrls: [ './my-account.component.scss' ] |
10 | }) | 11 | }) |
11 | export class MyAccountComponent { | 12 | export class MyAccountComponent implements OnInit { |
12 | menuEntries: TopMenuDropdownParam[] = [] | 13 | menuEntries: TopMenuDropdownParam[] = [] |
13 | 14 | ||
15 | private serverConfig: ServerConfig | ||
16 | |||
14 | constructor ( | 17 | constructor ( |
15 | private serverService: ServerService, | 18 | private serverService: ServerService, |
16 | private i18n: I18n | 19 | private i18n: I18n |
17 | ) { | 20 | ) { } |
21 | |||
22 | ngOnInit (): void { | ||
23 | this.serverConfig = this.serverService.getTmpConfig() | ||
24 | this.serverService.getConfig() | ||
25 | .subscribe(config => this.serverConfig = config) | ||
18 | 26 | ||
19 | const libraryEntries: TopMenuDropdownParam = { | 27 | const libraryEntries: TopMenuDropdownParam = { |
20 | label: this.i18n('My library'), | 28 | label: this.i18n('My library'), |
@@ -91,7 +99,7 @@ export class MyAccountComponent { | |||
91 | } | 99 | } |
92 | 100 | ||
93 | isVideoImportEnabled () { | 101 | isVideoImportEnabled () { |
94 | const importConfig = this.serverService.getConfig().import.videos | 102 | const importConfig = this.serverConfig.import.videos |
95 | 103 | ||
96 | return importConfig.http.enabled || importConfig.torrent.enabled | 104 | return importConfig.http.enabled || importConfig.torrent.enabled |
97 | } | 105 | } |