]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts
Enable video upload and edit
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / shared / video-caption-add-modal.component.ts
index 796fbe531ae9496fda8637cd2d9872d6cafa4c6c..1413e7262b6d01f5bc012d864c2c3dd6071d91f2 100644 (file)
@@ -60,6 +60,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
   hide () {
     this.closingModal = true
     this.openedModal.close()
+    this.form.reset()
   }
 
   isReplacingExistingCaption () {
@@ -71,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)
 
@@ -81,6 +80,6 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
       captionfile: this.form.value[ 'captionfile' ]
     })
 
-    this.form.reset()
+    this.hide()
   }
 }