You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Prevented clicks on 'Swap' button when it's not ready to send txs (#196)
### Description
It prevents clicking the 'Swap' button on the 'Confirm Swap' state by
adding a button disable condition that checks if the txs (approval &
swap or swap only) are ready to be confirmed. When it's not ready, the
button is disabled and has the grey colour as we do for the 'Continue'
button on the 'Swap' state.
### Other changes
Fixed this case:
Sometimes, it shows the 'Sending swap transaction' text when there's no
allowance to skip approval tx (therefore, there should be two TXs,
approval and swap, and corresponding the 'Sending two transactions:
Approval and Swap' text)
### Tested
**Description:**
There are two cases to test:
1. When there are two txs - an approval and a swap.
2. When there is only one tx - a swap one.
**STR:**
1. Navigate the app and connect your wallet.
3. Fill out the form with any amount.
4. Click the 'Continue' button as soon as it's enabled.
5. Click the 'Swap' button as soon as it's enabled.
**Expected result:**
1. The tx/s are sent as soon as you click the 'Swap' button.
2. It displays the 'Sending swap transaction', with only one tx to swap
directly.
3. It displays the 'Sending two transactions: Approval and Swap', with
two txs to approve and swap.
4. Swapped successfully; the balances are updated.
### Related issues
- Fixes #issue number here
### Checklist before requesting a review
- [ ] I have performed a self-review of my own code
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] The PR title follows the
[conventions](https://www.notion.so/Git-Branching-and-Commit-Message-Conventions-18f66f7d06444cfcbac5725ffbc7c04a?pvs=4#9355048863c549ef92fe210a8a1298aa)
- [ ] I have run the [regression
tests](https://www.notion.so/Mento-Web-App-Regression-Tests-37bd43a7da8d4e38b65993320a33d557)
---------
Co-authored-by: Andrew718PLTS <[email protected]>
0 commit comments