Commit 108feace authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: enable max swap amount (#3278)

* fix: enable max swap amount

* fix: bad syntax

* fix: unnecessary optional
parent e2c013a4
...@@ -83,8 +83,10 @@ export default function SwapButton({ disabled }: SwapButtonProps) { ...@@ -83,8 +83,10 @@ export default function SwapButton({ disabled }: SwapButtonProps) {
const actionProps = useMemo(() => { const actionProps = useMemo(() => {
if (disabled) return { disabled: true } if (disabled) return { disabled: true }
if (chainId && inputCurrencyAmount && inputCurrencyBalance?.greaterThan(inputCurrencyAmount)) { if (chainId && inputCurrencyAmount) {
if (approval === ApprovalState.PENDING) { if (!inputCurrencyBalance || inputCurrencyBalance.lessThan(inputCurrencyAmount)) {
return { disabled: true }
} else if (approval === ApprovalState.PENDING) {
return { return {
disabled: true, disabled: true,
update: { update: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment