1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Fix insufficient currency buy or receive error message (#16979)

This commit is contained in:
dragana8 2022-12-16 17:17:01 +01:00 committed by seaona
parent cb2f25f767
commit e7e72cf6fc

View File

@ -79,6 +79,7 @@ export default function GasDisplay({ gasError }) {
draftTransaction?.amount.error === INSUFFICIENT_TOKENS_ERROR;
const editingTransaction = unapprovedTxs[draftTransaction.id];
const supportsEIP1559V2 = eip1559V2Enabled && supportsEIP1559;
const currentNetworkName = networkName || currentProvider.nickname;
const transactionData = {
txParams: {
@ -424,7 +425,7 @@ export default function GasDisplay({ gasError }) {
]}
/>
</Box>
{(gasError || isInsufficientTokenError) && (
{(gasError || isInsufficientTokenError) && currentNetworkName && (
<Box
className="gas-display__warning-message"
data-testid="gas-warning-message"
@ -442,7 +443,7 @@ export default function GasDisplay({ gasError }) {
<Typography variant={TYPOGRAPHY.H7} align="left">
{t('insufficientCurrencyBuyOrReceive', [
nativeCurrency,
networkName ?? currentProvider.nickname,
currentNetworkName,
<Button
type="inline"
className="confirm-page-container-content__link"
@ -469,7 +470,7 @@ export default function GasDisplay({ gasError }) {
<Typography variant={TYPOGRAPHY.H7} align="left">
{t('insufficientCurrencyBuyOrReceive', [
draftTransaction.asset.details?.symbol ?? nativeCurrency,
networkName ?? currentProvider.nickname,
currentNetworkName,
`${t('buyAsset', [
draftTransaction.asset.details?.symbol ??
nativeCurrency,