From ca5b6ba7145f998bd406e4d4bd567a161857059b Mon Sep 17 00:00:00 2001 From: Matt <90358481+xbtmatt@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:57:38 -0800 Subject: [PATCH] [ECO-2548] Fix swap component inputs so it swaps the input/output amounts upon buy => sell and vice versa (#441) --- .../emojicoin/components/trade-emojicoin/SwapComponent.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx b/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx index 15b74c9d0..530abd695 100644 --- a/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx +++ b/src/typescript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx @@ -244,9 +244,8 @@ export default function SwapComponent({ { 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); }} />