- const uuid: string = this.route.snapshot.params[ 'uuid' ]
- this.videoService.getVideo(uuid)
- .pipe(
- switchMap(video => {
- return this.videoService
- .loadCompleteDescription(video.descriptionPath)
- .pipe(map(description => Object.assign(video, { description })))
- }),
- switchMap(video => {
- return this.videoChannelService
- .listAccountVideoChannels(video.account)
- .pipe(
- map(result => result.data),
- map(videoChannels => videoChannels.map(c => ({ id: c.id, label: c.displayName }))),
- map(videoChannels => ({ video, videoChannels }))
- )
- })
- )
- .subscribe(
- ({ video, videoChannels }) => {
- this.video = new VideoEdit(video)
- this.userVideoChannels = videoChannels
+ // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout
+ setTimeout(() => this.hydrateFormFromVideo())
+ },