diff options
Diffstat (limited to 'ui/app/selectors/selectors.js')
-rw-r--r-- | ui/app/selectors/selectors.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js index ac226900f..bea2cea33 100644 --- a/ui/app/selectors/selectors.js +++ b/ui/app/selectors/selectors.js @@ -1,4 +1,4 @@ -import {NETWORK_TYPES} from '../helpers/constants/common' +import { NETWORK_TYPES } from '../helpers/constants/common' import { stripHexPrefix } from 'ethereumjs-util' const abi = require('human-standard-token-abi') @@ -47,6 +47,7 @@ const selectors = { getAccountType, getNumberOfAccounts, getNumberOfTokens, + isEthereumNetwork, } module.exports = selectors @@ -292,6 +293,17 @@ function getIsMainnet (state) { return networkType === NETWORK_TYPES.MAINNET } +function isEthereumNetwork (state) { + const networkType = getNetworkIdentifier(state) + const { + KOVAN, + MAINNET, + RINKEBY, + ROPSTEN, + } = NETWORK_TYPES + return [ KOVAN, MAINNET, RINKEBY, ROPSTEN].includes(type => type === networkType) +} + function preferencesSelector ({ metamask }) { return metamask.preferences } |