From ba430d7516bc5b1324b60571ba7594460969b7fb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Dec 2019 15:31:54 +0100 Subject: Lazy load static objects --- .../+video-edit/shared/video-edit.component.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'client/src/app/videos/+video-edit/shared/video-edit.component.ts') diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index d0d5e2a2b..982e071ad 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -12,7 +12,7 @@ import { VideoCaptionService } from '@app/shared/video-caption' import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component' import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' import { removeElementFromArray } from '@app/shared/misc/utils' -import { VideoConstant, VideoPrivacy } from '../../../../../../shared' +import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared' import { VideoService } from '@app/shared/video/video.service' @Component({ @@ -51,6 +51,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { calendarTimezone: string calendarDateFormat: string + serverConfig: ServerConfig + private schedulerInterval: any private firstPatchDone = false private initialVideoCaptions: string[] = [] @@ -130,12 +132,19 @@ export class VideoEditComponent implements OnInit, OnDestroy { ngOnInit () { this.updateForm() - this.videoCategories = this.serverService.getVideoCategories() - this.videoLicences = this.serverService.getVideoLicences() - this.videoLanguages = this.serverService.getVideoLanguages() + this.serverService.getVideoCategories() + .subscribe(res => this.videoCategories = res) + this.serverService.getVideoLicences() + .subscribe(res => this.videoLicences = res) + this.serverService.getVideoLanguages() + .subscribe(res => this.videoLanguages = res) + + this.serverService.getVideoPrivacies() + .subscribe(privacies => this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies)) - const privacies = this.serverService.getVideoPrivacies() - this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies) + this.serverConfig = this.serverService.getTmpConfig() + this.serverService.getConfig() + .subscribe(config => this.serverConfig = config) this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) -- cgit v1.2.3