mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Fix provider menu selection indication
This commit is contained in:
parent
f7688ac3cf
commit
b1fb8da3b0
@ -240,6 +240,7 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
action: () => props.dispatch(actions.setProviderType('testnet')),
|
action: () => props.dispatch(actions.setProviderType('testnet')),
|
||||||
icon: h('.menu-icon.red-dot'),
|
icon: h('.menu-icon.red-dot'),
|
||||||
activeNetworkRender: props.network,
|
activeNetworkRender: props.network,
|
||||||
|
provider: props.provider,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
h(DropMenuItem, {
|
h(DropMenuItem, {
|
||||||
@ -250,13 +251,6 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
activeNetworkRender: props.provider.rpcTarget,
|
activeNetworkRender: props.provider.rpcTarget,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
h(DropMenuItem, {
|
|
||||||
label: 'Custom RPC',
|
|
||||||
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
|
|
||||||
action: () => this.props.dispatch(actions.showConfigPage()),
|
|
||||||
icon: h('i.fa.fa-question-circle.fa-lg'),
|
|
||||||
}),
|
|
||||||
|
|
||||||
this.renderCustomOption(props.provider.rpcTarget),
|
this.renderCustomOption(props.provider.rpcTarget),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
@ -508,7 +502,12 @@ App.prototype.toggleMetamaskActive = function () {
|
|||||||
App.prototype.renderCustomOption = function (rpcTarget) {
|
App.prototype.renderCustomOption = function (rpcTarget) {
|
||||||
switch (rpcTarget) {
|
switch (rpcTarget) {
|
||||||
case undefined:
|
case undefined:
|
||||||
return null
|
return h(DropMenuItem, {
|
||||||
|
label: 'Custom RPC',
|
||||||
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
|
||||||
|
action: () => this.props.dispatch(actions.showConfigPage()),
|
||||||
|
icon: h('i.fa.fa-question-circle.fa-lg'),
|
||||||
|
})
|
||||||
|
|
||||||
case 'http://localhost:8545':
|
case 'http://localhost:8545':
|
||||||
return h(DropMenuItem, {
|
return h(DropMenuItem, {
|
||||||
|
@ -42,7 +42,7 @@ DropMenuItem.prototype.activeNetworkRender = function () {
|
|||||||
if (providerType === 'mainnet') return h('.check', '✓')
|
if (providerType === 'mainnet') return h('.check', '✓')
|
||||||
break
|
break
|
||||||
case 'Morden Test Network':
|
case 'Morden Test Network':
|
||||||
if (activeNetwork === '2') return h('.check', '✓')
|
if (provider.type === 'testnet') return h('.check', '✓')
|
||||||
break
|
break
|
||||||
case 'Localhost 8545':
|
case 'Localhost 8545':
|
||||||
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')
|
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')
|
||||||
|
Loading…
Reference in New Issue
Block a user