Merge pull request #594 from MetaMask/i541-CustomMenuItemFix

Allow selecting custom rpc from menu even when custom rpc is selected
This commit is contained in:
kumavis 2016-08-29 12:49:17 -07:00 committed by GitHub
commit a9c738d4d3
4 changed files with 13 additions and 8 deletions

View File

@ -2,6 +2,8 @@
## Current Master
- Fix bug where provider menu did not allow switching to custom network from a custom network.
## 2.10.0 2016-08-29
- Changed transaction approval from notifications system to popup system.

File diff suppressed because one or more lines are too long

View File

@ -158,7 +158,7 @@
}
],
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"network": "loading",
"network": "166",
"seedWords": null,
"isConfirmed": true,
"isEthConfirmed": true,

View File

@ -249,6 +249,13 @@ 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', { ariaHidden: true }),
}),
this.renderCustomOption(props.provider.rpcTarget),
])
}
@ -501,12 +508,8 @@ App.prototype.toggleMetamaskActive = function () {
App.prototype.renderCustomOption = function (rpcTarget) {
switch (rpcTarget) {
case undefined:
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', { ariaHidden: true }),
})
return null
case 'http://localhost:8545':
return h(DropMenuItem, {
label: 'Custom RPC',