From e5ab8ab732af5a7b9f67e6fbf3621bd0ee78b68a Mon Sep 17 00:00:00 2001 From: Mononaut Date: Tue, 21 May 2024 22:12:33 +0000 Subject: [PATCH] Update default faucet min, revalidate on change --- frontend/src/app/components/faucet/faucet.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/faucet/faucet.component.ts b/frontend/src/app/components/faucet/faucet.component.ts index 0d0d29600..190330c3e 100644 --- a/frontend/src/app/components/faucet/faucet.component.ts +++ b/frontend/src/app/components/faucet/faucet.component.ts @@ -41,7 +41,7 @@ export class FaucetComponent implements OnInit, OnDestroy { private websocketService: WebsocketService, private audioService: AudioService ) { - this.initForm(1000, 500_000, null); + this.initForm(5000, 500_000, null); } ngOnDestroy() { @@ -93,7 +93,7 @@ export class FaucetComponent implements OnInit, OnDestroy { this.status = status; if (this.status.code !== 'ok') { this.error = this.status.code; - this.updateForm(this.status.min ?? 1000, this.status.max ?? 500_000, this.status.address); + this.updateForm(this.status.min ?? 5000, this.status.max ?? 500_000, this.status.address); return; } // update the form with the proper validation parameters @@ -156,12 +156,15 @@ export class FaucetComponent implements OnInit, OnDestroy { } else { this.faucetForm.get('address').setValidators([Validators.required, Validators.pattern(getRegex('address', 'testnet4')), this.getNotFaucetAddressValidator(faucetAddress)]); this.faucetForm.get('satoshis').setValidators([Validators.required, Validators.min(min), Validators.max(max)]); + this.faucetForm.get('satoshis').updateValueAndValidity(); + this.faucetForm.get('satoshis').markAsDirty(); } } setAmount(value: number): void { if (this.faucetForm) { this.faucetForm.get('satoshis').setValue(value); + this.faucetForm.get('satoshis').updateValueAndValidity(); this.faucetForm.get('satoshis').markAsDirty(); } }