Skip to content

Commit

Permalink
[ECO-2548] Fix swap component inputs so it swaps the input/output amo…
Browse files Browse the repository at this point in the history
…unts upon buy => sell and vice versa (#441)
  • Loading branch information
xbtmatt authored Dec 4, 2024
1 parent ca21716 commit ca5b6ba
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ export default function SwapComponent({
<FlipInputsArrow
onClick={() => {
setInputAmount(outputAmount);
// This is done as to not display an old value if the swap simulation fails.
setOutputAmount(0n);
setPrevious(0n);
setOutputAmount(inputAmount);
setPrevious(inputAmount);
setIsSell((v) => !v);
}}
/>
Expand Down

0 comments on commit ca5b6ba

Please sign in to comment.