]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts
Fix build
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / shared / video-caption-add-modal.component.ts
index eaf8197264366e49bfb54e960f33eb0f44113467..86c6e03e75be6f16856ebdba28d659ae9f4e18a8 100644 (file)
@@ -18,7 +18,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
 
   @Output() captionAdded = new EventEmitter<VideoCaptionEdit>()
 
-  @ViewChild('modal') modal: ElementRef
+  @ViewChild('modal', { static: true }) modal: ElementRef
 
   videoCaptionLanguages: VideoConstant<string>[] = []
 
@@ -72,8 +72,6 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
   }
 
   async addCaption () {
-    this.hide()
-
     const languageId = this.form.value[ 'language' ]
     const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
 
@@ -82,6 +80,6 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
       captionfile: this.form.value[ 'captionfile' ]
     })
 
-    this.form.reset()
+    this.hide()
   }
 }