1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix Insufficient number of substitutions for key "swapYourTokenBalance" (#11833)

* Fix Insufficient number of substitutions for key "swapYourTokenBalance"

* Use an empty string if there is no default symbol

* Add ? after SWAPS_CHAINID_DEFAULT_TOKEN_MAP[chainId]
This commit is contained in:
Daniel 2021-08-13 17:26:42 +02:00 committed by ryanml
parent a0d8894989
commit f5f923d208

View File

@ -52,7 +52,10 @@ import {
isSwapsDefaultTokenAddress,
isSwapsDefaultTokenSymbol,
} from '../../../../shared/modules/swaps.utils';
import { SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP } from '../../../../shared/constants/swaps';
import {
SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP,
SWAPS_CHAINID_DEFAULT_TOKEN_MAP,
} from '../../../../shared/constants/swaps';
import { resetSwapsPostFetchState, removeToken } from '../../../store/actions';
import { fetchTokenPrice, fetchTokenBalance } from '../swaps.util';
@ -370,7 +373,7 @@ export default function BuildQuote({
const swapYourTokenBalance = t('swapYourTokenBalance', [
fromTokenString || '0',
fromTokenSymbol,
fromTokenSymbol || SWAPS_CHAINID_DEFAULT_TOKEN_MAP[chainId]?.symbol || '',
]);
return (