NOTE:
Please see the comments inline of the code to better map out where each of the fixes below correspond in the code.
NOTE: will attach screen recordings / screenshots in comments below so as not to blow up this description section.
Fixes in this branch:
typing in an input amount that causes insufficient funds and then deleting the input amount to 0 still displays Insufficient Funds
relying on the quote as a source of truth for the sell amount can cause the button to flicker because the quote can still technically have a value / not have an error, even though it is now out of date
previously: the sellAmount calculation was returning two different orders of magnitude in the response which was incorrect. e.g, when there's a quote error, it would return the input amount (like "1.234") but if there's a quote, it would return the raw sell amount (like "12340") which we were using later for comparisons against another raw amount
Fixes APP-1601: gas button can display a fee of $0.00 instead of proper handling of amounts below $0.01
updated logic for "Enter Amount" label (please review)
updated the ordering to also reduce flickering of the button
WHAT STILL NEEDS TO BE FIXED:
(IN PROGRESS) incorporating Ben's final max swappable input changes: currently max input can incorrectly show insufficient funds; we will need the maxSwappableAmount to stop being updated on every gas update
(IN PROGRESS FROM GREGS) "tap to swap" button no longer has haptic feedback
(IN PROGRESS FROM GREGS) neither the review button nor the confirm swap button have press states (they should scale down on press)
NOTE: Please see the comments inline of the code to better map out where each of the fixes below correspond in the code.
NOTE: will attach screen recordings / screenshots in comments below so as not to blow up this description section.
Fixes in this branch:
sellAmount
calculation was returning two different orders of magnitude in the response which was incorrect. e.g, when there's a quote error, it would return the input amount (like "1.234") but if there's a quote, it would return the raw sell amount (like "12340") which we were using later for comparisons against another raw amountWHAT STILL NEEDS TO BE FIXED:
maxSwappableAmount
to stop being updated on every gas update