From 15a7387da888492068e2ce3d1e39639d142f6c6e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Dec 2017 14:29:55 +0100 Subject: Customize select --- client/src/app/videos/+video-edit/video-update.component.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'client/src/app/videos/+video-edit/video-update.component.ts') diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 08b74f4c3..941ef2478 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts @@ -5,8 +5,10 @@ import { NotificationsService } from 'angular2-notifications' import 'rxjs/add/observable/forkJoin' import { VideoPrivacy } from '../../../../../shared/models/videos' import { ServerService } from '../../core' +import { AuthService } from '../../core/auth' import { FormReactive } from '../../shared' import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message' +import { populateAsyncUserVideoChannels } from '../../shared/misc/utils' import { VideoEdit } from '../../shared/video/video-edit.model' import { VideoService } from '../../shared/video/video.service' @@ -24,6 +26,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { formErrors: { [ id: string ]: string } = {} validationMessages: ValidatorMessage = {} videoPrivacies = [] + userVideoChannels = [] constructor ( private formBuilder: FormBuilder, @@ -31,7 +34,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { private router: Router, private notificationsService: NotificationsService, private serverService: ServerService, - private videoService: VideoService + private videoService: VideoService, + private authService: AuthService ) { super() } @@ -44,7 +48,12 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { ngOnInit () { this.buildForm() - this.videoPrivacies = this.serverService.getVideoPrivacies() + this.serverService.videoPrivaciesLoaded + .subscribe( + () => this.videoPrivacies = this.serverService.getVideoPrivacies() + ) + + populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) const uuid: string = this.route.snapshot.params['uuid'] this.videoService.getVideo(uuid) -- cgit v1.2.3