Skip to content

Commit

Permalink
fix: solve wrong behavior of swap balance when trade isn't exact in
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturHoncharuk committed Dec 16, 2024
1 parent a2f3ba4 commit e730c53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/features/swap/components/composite/balance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export const Balance = ({ type }: BalanceProps) => {
}, [isUSDPriceNegative]);

const error = useMemo(() => {
if (!bnBalanceAmount || !selectedTokensAmount[type]) return false;
if (!_refExactGetter || !bnBalanceAmount || !selectedTokensAmount[type])
return false;

const bnInputBalance = bnBalanceAmount?._hex;
const bnSelectedAmount = ethers.utils.parseEther(
Expand Down

0 comments on commit e730c53

Please sign in to comment.