aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-18 15:31:54 +0100
committerChocobozzz <me@florianbigard.com>2019-12-18 15:40:59 +0100
commitba430d7516bc5b1324b60571ba7594460969b7fb (patch)
treedf5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/+my-account/my-account.component.ts
parent5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff)
downloadPeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip
Lazy load static objects
Diffstat (limited to 'client/src/app/+my-account/my-account.component.ts')
-rw-r--r--client/src/app/+my-account/my-account.component.ts16
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 @@
1import { Component } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ServerService } from '@app/core' 2import { ServerService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component' 4import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component'
5import { 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})
11export class MyAccountComponent { 12export 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 }