adding reactivity and error message handling

This commit is contained in:
2025-12-03 17:43:17 -04:00
parent d07ff55c13
commit d4e41821a6
3 changed files with 49 additions and 28 deletions

View File

@@ -94,6 +94,8 @@ export function SwapForm() {
const swapResult = swapAmounts[0]; // Get the first (and should be only) result
const formattedAmount = formatUnits(swapResult.amountOut, selectedToToken.decimals);
setToAmount(formattedAmount);
} else {
setToAmount('');
}
}, [swapAmounts, selectedToToken, hasInsufficientBalance]);