]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Select first available channel when accepting ownership change (#3382)
authorFlorian CUNY <poslovitch@bentobox.world>
Tue, 1 Dec 2020 14:04:29 +0000 (15:04 +0100)
committerGitHub <noreply@github.com>
Tue, 1 Dec 2020 14:04:29 +0000 (15:04 +0100)
* Select first available channel when accepting ownership change

Implements https://github.com/Chocobozzz/PeerTube/issues/2240

* Made use of #patchValue() to set the default selected value

And removed the disabled state for the Accept button

client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts

index def1cbab6fa99f49c13f7da7194773e2a33c6e82..27aab13b654f574054a26e164eb013f6564e68d9 100644 (file)
@@ -28,7 +28,6 @@
 
       <input
           type="submit" i18n-value value="Accept" class="action-button-submit"
-          [disabled]="!form.valid"
           (click)="close()"
       >
     </div>
index 51e9b2a6d99d844294ddfcb915d09eac87c754c3..0e23957545b9edda60418fb7dab5a91077cd7423 100644 (file)
@@ -47,6 +47,11 @@ export class MyAcceptOwnershipComponent extends FormReactive implements OnInit {
   }
 
   show (videoChangeOwnership: VideoChangeOwnership) {
+    // Select the first available channel by default
+    this.form.patchValue({
+      channel: this.videoChannels[0].id
+    })
+
     this.videoChangeOwnership = videoChangeOwnership
     this.modalService
       .open(this.modal, { centered: true })