Select first available channel when accepting ownership change (#3382)

* 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
pull/3394/head
Florian CUNY 2020-12-01 15:04:29 +01:00 committed by GitHub
parent 117c643e45
commit a3f1595f79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,6 @@
<input
type="submit" i18n-value value="Accept" class="action-button-submit"
[disabled]="!form.valid"
(click)="close()"
>
</div>

View 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 })