Skip to content

Commit

Permalink
fix: select the first token from the chain selected (#2156)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Feb 27, 2024
1 parent b880f0b commit 93415ca
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ export const BuyWithCryptoModal = (props: Props) => {
manaTokenOnSelectedChain || getMANAToken(selectedChain)
) // if it's not in the providerTokens, create the object manually with the right conectract address
} catch (error) {
setSelectedToken(providerTokens[0])
const selectedChainTokens = providerTokens.filter(
t => t.chainId === selectedChain.toString()
)
setSelectedToken(selectedChainTokens[0])
}
}
}, [
Expand Down Expand Up @@ -796,7 +799,9 @@ export const BuyWithCryptoModal = (props: Props) => {
})}
</span>
) : null}
{!canBuyAsset && !isFetchingBalance && !isFetchingRoute ? (
{canBuyAsset === false &&
!isFetchingBalance &&
!isFetchingRoute ? (
<span className={styles.warning}>
{t('buy_with_crypto_modal.insufficient_funds', {
token: insufficientToken?.symbol || 'MANA'
Expand Down

0 comments on commit 93415ca

Please sign in to comment.