Skip to content

Commit

Permalink
Updated: disable button if refund/deposit address is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
juanolmedo1 committed Jan 27, 2025
1 parent 6ae7609 commit e861e7d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions source/scenes/swap/SwapTokens/SwapTokens.container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,24 @@ const SwapTokenContainer: FC<ISwapTokensContainer> = ({ navigation }) => {
!isBalanceError &&
!isRateError &&
fromAmount > FROM_AMOUNT_ZERO &&
currencyRate?.toAmount > TO_AMOUNT_ZERO
currencyRate?.toAmount > TO_AMOUNT_ZERO &&
!!depositAsset &&
!!refundAsset
) {
setIsNextButtonDisabled(false);
} else {
setIsNextButtonDisabled(true);
}
}, [swapFrom, swapTo, fromAmount, isBalanceError, isRateError, currencyRate]);
}, [
swapFrom,
swapTo,
fromAmount,
isBalanceError,
isRateError,
currencyRate,
depositAsset,
refundAsset,
]);

// Updates the exchange rate when the from amount is changes.
useEffect(() => {
Expand Down

0 comments on commit e861e7d

Please sign in to comment.