From a3f1595f791e3084398f983847c4bac43498a541 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Tue, 1 Dec 2020 15:04:29 +0100 Subject: [PATCH] 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 --- .../my-accept-ownership/my-accept-ownership.component.html | 1 - .../my-accept-ownership/my-accept-ownership.component.ts | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html index def1cbab6..27aab13b6 100644 --- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html +++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html @@ -28,7 +28,6 @@ diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts index 51e9b2a6d..0e2395754 100644 --- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts +++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts @@ -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 })