trezor-suite
trezor-suite copied to clipboard
Transaction is never fetched after Maximum 2 decimals allowed error is fixed by deleting too many decimals
Describe the bug
Transaction is never fetched after Maximum 2 decimals allowed
error is fixed by deleting too many decimals
Steps to reproduce:
- Try to send more than 2 fiat decimals
-
Maximum 2 decimals allowed
error is rendered - Delete decimals
- Transaction is never prepared for signing
Info:
- Suite version: desktop 24.2.4 (748176286ae231aae44c83981a62b174b7605e1a)
- Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) TrezorSuite/24.2.4 Chrome/118.0.5993.129 Electron/27.0.4 Safari/537.36
- OS: MacIntel
- Screen: 1512x982
- Device: Trezor T2B1 2.6.4 regular (revision 42e9ed0e09033d474dee1a560fe5870646fa440e)
- Transport: BridgeTransport 2.0.33
Screenshots:
https://github.com/trezor/trezor-suite/assets/31506317/6b60b0f5-9899-4728-91ae-4b8e3bc63595
Additional context
https://github.com/trezor/trezor-suite/assets/152851523/d3d7005b-1bcd-4bcc-957d-590064df41e4
The problem is here:
packages/suite/src/views/wallet/send/components/ReviewButton.tsx
Here is the problem:
- In the
... send/components/Outputs/components/Amount/components/Fiat.tsx
there is the problem that it hashandleChange
directly on the input. - In this handler the
errors
are checked, - but those errors comes from hooks and react-hook-form, and are "late" (
handleChange
happens before the react hook form reevaluates the new state)
This is hell, I suggest to remove react-hook-form completely and rewrite the send from in some sane way.