]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-add/video-add.component.ts
Client: fix progress bar and tags validation issues
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-add / video-add.component.ts
index d12a7d572481365dc311818bde864f91426d7a05..0a8b8293b914f31a264ebd649ebedeed7dc9ed11 100644 (file)
@@ -110,7 +110,7 @@ export class VideoAddComponent extends FormReactive implements OnInit {
     if (event.keyCode === 13) {
       // Check if the tag is valid and does not already exist
       if (
-        currentTag !== '' &&
+        currentTag.length >= 2 &&
         this.form.controls['currentTag'].valid &&
         this.tags.indexOf(currentTag) === -1
       ) {
@@ -137,7 +137,13 @@ export class VideoAddComponent extends FormReactive implements OnInit {
     // TODO: wait for https://github.com/valor-software/ng2-file-upload/pull/242
     item.alias = 'videofile';
 
+    // FIXME: remove
+    // Run detection change for progress bar
+    const interval = setInterval(() => { ; }, 250);
+
     item.onSuccess = () => {
+      clearInterval(interval);
+
       console.log('Video uploaded.');
 
       // Print all the videos once it's finished
@@ -145,6 +151,8 @@ export class VideoAddComponent extends FormReactive implements OnInit {
     };
 
     item.onError = (response: string, status: number) => {
+      clearInterval(interval);
+
       // We need to handle manually these cases beceause we use the FileUpload component
       if (status === 400) {
         this.error = response;
@@ -163,7 +171,6 @@ export class VideoAddComponent extends FormReactive implements OnInit {
       }
     };
 
-
     this.uploader.uploadAll();
   }
 }