aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/abstract-video-list.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/shared/video/abstract-video-list.ts
parent5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff)
downloadPeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip
Lazy load static objects
Diffstat (limited to 'client/src/app/shared/video/abstract-video-list.ts')
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index 2926b179b..faeea27d9 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -13,7 +13,7 @@ import { Notifier, ServerService } from '@app/core'
13import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' 13import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
14import { I18n } from '@ngx-translate/i18n-polyfill' 14import { I18n } from '@ngx-translate/i18n-polyfill'
15import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' 15import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date'
16import { ResultList } from '@shared/models' 16import { ResultList, ServerConfig } from '@shared/models'
17 17
18enum GroupDate { 18enum GroupDate {
19 UNKNOWN = 0, 19 UNKNOWN = 0,
@@ -61,6 +61,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
61 61
62 onDataSubject = new Subject<any[]>() 62 onDataSubject = new Subject<any[]>()
63 63
64 protected serverConfig: ServerConfig
65
64 protected abstract notifier: Notifier 66 protected abstract notifier: Notifier
65 protected abstract authService: AuthService 67 protected abstract authService: AuthService
66 protected abstract route: ActivatedRoute 68 protected abstract route: ActivatedRoute
@@ -85,6 +87,10 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
85 } 87 }
86 88
87 ngOnInit () { 89 ngOnInit () {
90 this.serverConfig = this.serverService.getTmpConfig()
91 this.serverService.getConfig()
92 .subscribe(config => this.serverConfig = config)
93
88 this.groupedDateLabels = { 94 this.groupedDateLabels = {
89 [GroupDate.UNKNOWN]: null, 95 [GroupDate.UNKNOWN]: null,
90 [GroupDate.TODAY]: this.i18n('Today'), 96 [GroupDate.TODAY]: this.i18n('Today'),
@@ -251,7 +257,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
251 } 257 }
252 258
253 let path = this.router.url 259 let path = this.router.url
254 if (!path || path === '/') path = this.serverService.getConfig().instance.defaultClientRoute 260 if (!path || path === '/') path = this.serverConfig.instance.defaultClientRoute
255 261
256 this.router.navigate([ path ], { queryParams, replaceUrl: true, queryParamsHandling: 'merge' }) 262 this.router.navigate([ path ], { queryParams, replaceUrl: true, queryParamsHandling: 'merge' })
257 } 263 }