mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
Compare the networkId against the correct enum in eth and token overview components (#9485)
This commit is contained in:
parent
dd3c2cc3ec
commit
94810ce9c9
@ -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 ? (
|
||||
<IconButton
|
||||
className="eth-overview__button"
|
||||
disabled={networkId !== '1'}
|
||||
disabled={networkId !== MAINNET_NETWORK_ID}
|
||||
Icon={SwapIcon}
|
||||
onClick={() => {
|
||||
if (networkId === '1') {
|
||||
if (networkId === MAINNET_NETWORK_ID) {
|
||||
enteredSwapsEvent()
|
||||
dispatch(setSwapsFromToken({
|
||||
...ETH_SWAPS_TOKEN_OBJECT,
|
||||
|
@ -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 ? (
|
||||
<IconButton
|
||||
className="token-overview__button"
|
||||
disabled={networkId !== '1'}
|
||||
disabled={networkId !== MAINNET_NETWORK_ID}
|
||||
Icon={SwapIcon}
|
||||
onClick={() => {
|
||||
if (networkId === '1') {
|
||||
if (networkId === MAINNET_NETWORK_ID) {
|
||||
enteredSwapsEvent()
|
||||
dispatch(setSwapsFromToken({ ...token, iconUrl: assetImages[token.address] }))
|
||||
if (usingHardwareWallet) {
|
||||
|
Loading…
Reference in New Issue
Block a user