mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #356 from MetaMask/networkDropdownFix
Network dropdown fix
This commit is contained in:
commit
8d9a0e7177
@ -46,6 +46,7 @@ function mapStateToProps (state) {
|
|||||||
unconfMsgs: state.metamask.unconfMsgs,
|
unconfMsgs: state.metamask.unconfMsgs,
|
||||||
menuOpen: state.appState.menuOpen,
|
menuOpen: state.appState.menuOpen,
|
||||||
network: state.metamask.network,
|
network: state.metamask.network,
|
||||||
|
provider: state.metamask.provider,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,6 +229,7 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
action: () => props.dispatch(actions.setRpcTarget('http://localhost:8545')),
|
action: () => props.dispatch(actions.setRpcTarget('http://localhost:8545')),
|
||||||
icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }),
|
icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }),
|
||||||
}),
|
}),
|
||||||
|
this.renderCustomOption(props.provider.rpcTarget),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,3 +357,22 @@ App.prototype.toggleMetamaskActive = function () {
|
|||||||
this.props.dispatch(actions.lockMetamask(false))
|
this.props.dispatch(actions.lockMetamask(false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 }),
|
||||||
|
})
|
||||||
|
|
||||||
|
default:
|
||||||
|
return h(DropMenuItem, {
|
||||||
|
label: `${rpcTarget}`,
|
||||||
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
|
||||||
|
icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user