Merge pull request #506 from MetaMask/FixNetworkReference

Fix network name reference
feature/default_network_editable
Dan Finlay 8 years ago committed by GitHub
commit 212f9cf945
  1. 5
      ui/app/components/drop-menu-item.js
  2. 7
      ui/app/components/network.js

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

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

Loading…
Cancel
Save