Merge pull request #764 from MetaMask/761-FixCustomMordenIndication

Fix provider menu selection indication
This commit is contained in:
Kevin Serrano 2016-10-26 11:06:29 -07:00 committed by GitHub
commit 2dad59b561
3 changed files with 10 additions and 9 deletions

View File

@ -3,6 +3,8 @@
## Current Master
- Add a check for improper Transaction data.
- Fix bug where custom provider selection could show duplicate items.
- Fix bug where connecting to a local morden node would make two providers appear selected.
- Fix bug that was sometimes preventing transactions from being sent.
## 2.13.5 2016-10-18

View File

@ -240,6 +240,7 @@ App.prototype.renderNetworkDropdown = function () {
action: () => props.dispatch(actions.setProviderType('testnet')),
icon: h('.menu-icon.red-dot'),
activeNetworkRender: props.network,
provider: props.provider,
}),
h(DropMenuItem, {
@ -250,13 +251,6 @@ App.prototype.renderNetworkDropdown = function () {
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),
])
}
@ -508,7 +502,12 @@ App.prototype.toggleMetamaskActive = function () {
App.prototype.renderCustomOption = function (rpcTarget) {
switch (rpcTarget) {
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':
return h(DropMenuItem, {

View File

@ -42,7 +42,7 @@ DropMenuItem.prototype.activeNetworkRender = function () {
if (providerType === 'mainnet') return h('.check', '✓')
break
case 'Morden Test Network':
if (activeNetwork === '2') return h('.check', '✓')
if (provider.type === 'testnet') return h('.check', '✓')
break
case 'Localhost 8545':
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')