From 94810ce9c92c479a45e89948b2d393f32918d356 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 6 Oct 2020 17:34:53 -0230 Subject: [PATCH] Compare the networkId against the correct enum in eth and token overview components (#9485) --- ui/app/components/app/wallet-overview/eth-overview.js | 5 +++-- ui/app/components/app/wallet-overview/token-overview.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/app/components/app/wallet-overview/eth-overview.js b/ui/app/components/app/wallet-overview/eth-overview.js index 240a7be27..401a96fd8 100644 --- a/ui/app/components/app/wallet-overview/eth-overview.js +++ b/ui/app/components/app/wallet-overview/eth-overview.js @@ -20,6 +20,7 @@ import SendIcon from '../../ui/icon/overview-send-icon.component' import { getSwapsFeatureLiveness, setSwapsFromToken } from '../../../ducks/swaps/swaps' import { ETH_SWAPS_TOKEN_OBJECT } from '../../../helpers/constants/swaps' import IconButton from '../../ui/icon-button' +import { MAINNET_NETWORK_ID } from '../../../../../app/scripts/controllers/network/enums' import WalletOverview from './wallet-overview' const EthOverview = ({ className }) => { @@ -112,10 +113,10 @@ const EthOverview = ({ className }) => { {swapsEnabled ? ( { - if (networkId === '1') { + if (networkId === MAINNET_NETWORK_ID) { enteredSwapsEvent() dispatch(setSwapsFromToken({ ...ETH_SWAPS_TOKEN_OBJECT, diff --git a/ui/app/components/app/wallet-overview/token-overview.js b/ui/app/components/app/wallet-overview/token-overview.js index 8952fd42e..af765409e 100644 --- a/ui/app/components/app/wallet-overview/token-overview.js +++ b/ui/app/components/app/wallet-overview/token-overview.js @@ -14,6 +14,7 @@ import { useTokenFiatAmount } from '../../../hooks/useTokenFiatAmount' import { updateSendToken } from '../../../store/actions' import { getSwapsFeatureLiveness, setSwapsFromToken } from '../../../ducks/swaps/swaps' import { getAssetImages, getCurrentKeyring, getCurrentNetworkId } from '../../../selectors/selectors' +import { MAINNET_NETWORK_ID } from '../../../../../app/scripts/controllers/network/enums' import SwapIcon from '../../ui/icon/swap-icon.component' import SendIcon from '../../ui/icon/overview-send-icon.component' @@ -81,10 +82,10 @@ const TokenOverview = ({ className, token }) => { {swapsEnabled ? ( { - if (networkId === '1') { + if (networkId === MAINNET_NETWORK_ID) { enteredSwapsEvent() dispatch(setSwapsFromToken({ ...token, iconUrl: assetImages[token.address] })) if (usingHardwareWallet) {