X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-edit%2Fvideo-add-components%2Fvideo-send.ts;h=b32f16950908a8f05f72557b38336ef0f3bd7622;hb=45c6bcf312d2e9578501eaaf7511183bc570fe91;hp=1bf22e1a93aa4b39171916e0c80766f5e80d4fde;hpb=c199c427d4ae586339822320f20f512a7a19dc3f;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 1bf22e1a9..b32f16950 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 @@ -1,10 +1,9 @@ import { EventEmitter, OnInit } from '@angular/core' import { LoadingBarService } from '@ngx-loading-bar/core' -import { NotificationsService } from 'angular2-notifications' +import { AuthService, Notifier, ServerService } from '@app/core' import { catchError, switchMap, tap } from 'rxjs/operators' import { FormReactive } from '@app/shared' -import { VideoConstant, VideoPrivacy } from '../../../../../../shared' -import { AuthService, ServerService } from '@app/core' +import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared' import { VideoService } from '@app/shared/video/video.service' import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' import { VideoCaptionService } from '@app/shared/video-caption' @@ -21,14 +20,16 @@ export abstract class VideoSend extends FormReactive implements OnInit { firstStepChannelId = 0 abstract firstStepDone: EventEmitter + abstract firstStepError: EventEmitter protected abstract readonly DEFAULT_VIDEO_PRIVACY: VideoPrivacy protected loadingBar: LoadingBarService - protected notificationsService: NotificationsService + protected notifier: Notifier protected authService: AuthService protected serverService: ServerService protected videoService: VideoService protected videoCaptionService: VideoCaptionService + protected serverConfig: ServerConfig abstract canDeactivate (): CanComponentDeactivateResult @@ -38,10 +39,14 @@ export abstract class VideoSend extends FormReactive implements OnInit { populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) .then(() => this.firstStepChannelId = this.userVideoChannels[ 0 ].id) - this.serverService.videoPrivaciesLoaded + this.serverConfig = this.serverService.getTmpConfig() + this.serverService.getConfig() + .subscribe(config => this.serverConfig = config) + + this.serverService.getVideoPrivacies() .subscribe( - () => { - this.videoPrivacies = this.serverService.getVideoPrivacies() + privacies => { + this.videoPrivacies = privacies this.firstStepPrivacyId = this.DEFAULT_VIDEO_PRIVACY })