- .subscribe(
- () => {
- this.isUpdatingVideo = false
- this.loadingBar.complete()
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video updated.'))
- this.router.navigate([ '/videos/watch', this.video.uuid ])
- },
-
- err => {
- this.isUpdatingVideo = false
- this.notificationsService.error(this.i18n('Error'), err.message)
- console.error(err)
- }
- )
+ .pipe(
+ // Then update captions
+ switchMap(() => this.videoCaptionService.updateCaptions(this.video.id, this.videoCaptions))
+ )
+ .subscribe(
+ () => {
+ this.isUpdatingVideo = false
+ this.loadingBar.complete()
+ this.notificationsService.success(this.i18n('Success'), this.i18n('Video updated.'))
+ this.router.navigate([ '/videos/watch', this.video.uuid ])
+ },
+
+ err => {
+ this.isUpdatingVideo = false
+ this.notificationsService.error(this.i18n('Error'), err.message)
+ console.error(err)
+ }
+ )