import { SelectChannelItem } from 'src/types/select-options-item.model'
import { Directive, EventEmitter, OnInit } from '@angular/core'
import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core'
-import { listUserChannels } from '@app/helpers'
+import { listUserChannelsForSelect } from '@app/helpers'
import { FormReactive } from '@app/shared/shared-forms'
import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
ngOnInit () {
this.buildForm({})
- listUserChannels(this.authService)
+ listUserChannelsForSelect(this.authService)
.subscribe(channels => {
this.userVideoChannels = channels
this.firstStepChannelId = this.userVideoChannels[0].id
this.serverService.getVideoPrivacies()
.subscribe(
privacies => {
- const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies)
+ const defaultPrivacy = this.serverConfig.defaults.publish.privacy
+
+ const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies, defaultPrivacy)
this.videoPrivacies = videoPrivacies
this.firstStepPrivacyId = defaultPrivacyId
})
}
- checkForm () {
- this.forceCheck()
-
- return this.form.valid
- }
-
protected updateVideoAndCaptions (video: VideoEdit) {
this.loadingBar.useRef().start()
})
)
}
+
+ protected async isFormValid () {
+ await this.waitPendingCheck()
+ this.forceCheck()
+
+ return this.form.valid
+ }
}