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

Merge pull request #506 from MetaMask/FixNetworkReference

Fix network name reference
This commit is contained in:
Dan Finlay 2016-07-29 13:08:14 -07:00 committed by GitHub
commit 212f9cf945
2 changed files with 9 additions and 3 deletions

View File

@ -34,14 +34,15 @@ DropMenuItem.prototype.render = function () {
DropMenuItem.prototype.activeNetworkRender = function () {
let activeNetwork = this.props.activeNetworkRender
let { provider } = this.props
let providerType = provider ? provider.type : null
if (activeNetwork === undefined) return
switch (this.props.label) {
case 'Main Ethereum Network':
if (provider.type === 'mainnet') return h('.check', '✓')
if (providerType === 'mainnet') return h('.check', '✓')
break
case 'Ethereum Classic Network':
if (provider.type === 'classic') return h('.check', '✓')
if (providerType === 'classic') return h('.check', '✓')
break
case 'Morden Test Network':
if (activeNetwork === '2') return h('.check', '✓')

View File

@ -13,7 +13,12 @@ function Network () {
Network.prototype.render = function () {
const props = this.props
const networkNumber = props.network
const providerName = props.provider.type
let providerName
try {
providerName = props.provider.type
} catch (e) {
providerName = null
}
let iconName, hoverText
if (networkNumber === 'loading') {