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-caption-add-modal.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts') diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts index 86c6e03e7..1a9bf5171 100644 --- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts @@ -5,7 +5,7 @@ import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validator import { ServerService } from '@app/core' import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' -import { VideoConstant } from '../../../../../../shared' +import { ServerConfig, VideoConstant } from '../../../../../../shared' @Component({ selector: 'my-video-caption-add-modal', @@ -15,6 +15,7 @@ import { VideoConstant } from '../../../../../../shared' export class VideoCaptionAddModalComponent extends FormReactive implements OnInit { @Input() existingCaptions: string[] + @Input() serverConfig: ServerConfig @Output() captionAdded = new EventEmitter() @@ -35,15 +36,16 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni } get videoCaptionExtensions () { - return this.serverService.getConfig().videoCaption.file.extensions + return this.serverConfig.videoCaption.file.extensions } get videoCaptionMaxSize () { - return this.serverService.getConfig().videoCaption.file.size.max + return this.serverConfig.videoCaption.file.size.max } ngOnInit () { - this.videoCaptionLanguages = this.serverService.getVideoLanguages() + this.serverService.getVideoLanguages() + .subscribe(languages => this.videoCaptionLanguages = languages) this.buildForm({ language: this.videoCaptionsValidatorsService.VIDEO_CAPTION_LANGUAGE, -- cgit v1.2.3