]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix error when clicking on the disabled publish button
authorChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 07:04:43 +0000 (09:04 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 07:04:43 +0000 (09:04 +0200)
client/src/app/videos/+video-edit/video-add-components/video-upload.component.html
client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts

index ff0e45413ff756fb2580e121f8fa1835ac1a9cc3..fa57c8cb58f0e93056c47d701e897d657cbc05a8 100644 (file)
 
     <div class="submit-button"
        (click)="updateSecondStep()"
-       [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true || videoUploaded !== true }"
+       [ngClass]="{ disabled: isPublishingButtonDisabled() }"
     >
       <span class="icon icon-validate"></span>
-      <input type="button" i18n-value value="Publish" />
+      <input [disabled]="isPublishingButtonDisabled()" type="button" i18n-value value="Publish" />
     </div>
   </div>
 </form>
\ No newline at end of file
index 5844418171cc4aa5c52a707459e407d68f439567..941dc5441edac3f2dc56f3e6773ddb6a809eb314 100644 (file)
@@ -206,6 +206,12 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
     )
   }
 
+  isPublishingButtonDisabled () {
+    return !this.form.valid ||
+      this.isUpdatingVideo === true ||
+      this.videoUploaded !== true
+  }
+
   updateSecondStep () {
     if (this.checkForm() === false) {
       return