only set amountIn when swapping if amountOut is gt 0

This commit is contained in:
tjs 2022-08-31 11:10:34 -04:00
parent 9d7f8e5158
commit 5832b69902
1 changed files with 3 additions and 1 deletions

View File

@ -120,7 +120,9 @@ const SwapForm = () => {
)
const handleSwitchTokens = useCallback(() => {
if (amountIn?.gt(0)) {
setAmountInFormValue(amountOut.toString())
}
const inputBank = mangoStore.getState().swap.inputBank
const outputBank = mangoStore.getState().swap.outputBank
set((s) => {