Skip to content

Commit

Permalink
fix: ensure 'useMax' button visibility for token balances > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
fraolb committed Dec 10, 2024
1 parent 64cce0a commit a2d823a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/swap/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function SwapFormInputs({ balances }: { balances: AccountBalances }) {
}, [setFieldValue, chain, values, swappableTokenOptions, isConnected])

const roundedBalance = fromWeiRounded(balances[fromTokenId], Tokens[fromTokenId].decimals)
const isRoundedBalanceGreaterThanZero = Boolean(Number.parseInt(roundedBalance) > 0)
const isRoundedBalanceGreaterThanZero = Boolean(Number.parseFloat(roundedBalance) > 0)
const onClickUseMax = () => {
const maxAmount = fromWei(balances[fromTokenId], Tokens[fromTokenId].decimals)
setFieldValue('amount', maxAmount)
Expand Down

0 comments on commit a2d823a

Please sign in to comment.