HomePhabricator

[Cashtab] Clean up conditions for disabling Send button

Description

[Cashtab] Clean up conditions for disabling Send button

Summary:
T3385

Many validation checks on Send screen -- together with desire to not show validation errors when user first loads the screen -- have made this set of conditions complex.

Store in single variable and add comments.

Disable send on page initial load state, which is not valid. Because isNaN('') === false (TIL), add condition for this check (prevents case of address being entered, value not yet entered -- button is enabled and you can still get a nonsense modal).

Test Plan:
npm test

npm start, navigate to send screen. Button should be disabled. Enter valid address. Button still disabled. Enter valid amount. Button enabled.

Enter valid multisend, valid msg input.

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D15121

Details

Provenance
bytesofmanAuthored on Jan 9 2024, 23:26
bytesofmanPushed on Jan 11 2024, 13:46
Reviewer
Restricted Project
Differential Revision
D15121: [Cashtab] Clean up conditions for disabling Send button
Parents
rABCd21c7c6ccbeb: qt: Revamp ClientModel code to handle core signals
Branches
Unknown
Tags
Unknown