X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fvideo-add-components%2Fvideo-send.ts;h=ce8de049d85d0b5a51c755ee36c76b3da758434c;hb=5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565;hp=a185892fe36d1ce6d10f461a52149c9276f1afc8;hpb=2989628b7913383b39ac34c7db8666a21f8e5037;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts index a185892fe..ce8de049d 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts @@ -15,21 +15,24 @@ export abstract class VideoSend extends FormReactive implements OnInit { videoPrivacies: VideoConstant[] = [] videoCaptions: VideoCaptionEdit[] = [] - firstStepPrivacyId = 0 - firstStepChannelId = 0 + firstStepPrivacyId: VideoPrivacy + firstStepChannelId: number abstract firstStepDone: EventEmitter abstract firstStepError: EventEmitter - protected abstract readonly DEFAULT_VIDEO_PRIVACY: VideoPrivacy protected loadingBar: LoadingBarService protected notifier: Notifier protected authService: AuthService + protected serverService: ServerService protected videoService: VideoService protected videoCaptionService: VideoCaptionService + protected serverConfig: HTMLServerConfig + protected highestPrivacy: VideoPrivacy + abstract canDeactivate (): CanComponentDeactivateResult ngOnInit () { @@ -46,9 +49,12 @@ export abstract class VideoSend extends FormReactive implements OnInit { this.serverService.getVideoPrivacies() .subscribe( privacies => { - this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies) + const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies) + + this.videoPrivacies = videoPrivacies + this.firstStepPrivacyId = defaultPrivacyId - this.firstStepPrivacyId = this.DEFAULT_VIDEO_PRIVACY + this.highestPrivacy = this.videoService.getHighestAvailablePrivacy(privacies) }) }