1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix custom provider indication

This commit is contained in:
Dan Finlay 2017-07-26 15:30:41 -07:00
parent bc65484e1b
commit c071591adb
2 changed files with 6 additions and 6 deletions

View File

@ -719,7 +719,7 @@ function setDefaultRpcTarget (rpcList) {
}
function setRpcTarget (newRpc) {
log.debug(`background.setRpcTarget`)
log.debug(`background.setRpcTarget: ${newRpc}`)
return (dispatch) => {
background.setCustomRpc(newRpc, (err, result) => {
if (err) {

View File

@ -519,7 +519,7 @@ App.prototype.renderCustomOption = function (provider) {
DropdownMenuItem,
{
key: rpcTarget,
onClick: () => props.dispatch(actions.setCustomRpc(rpcTarget)),
onClick: () => props.dispatch(actions.setRpcTarget(rpcTarget)),
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
},
[
@ -553,24 +553,24 @@ App.prototype.getNetworkName = function () {
}
App.prototype.renderCommonRpc = function (rpcList, provider) {
const { rpcTarget } = provider
const props = this.props
const rpcTarget = provider.rpcTarget
return rpcList.map((rpc) => {
if ((rpc === 'http://localhost:8545') || (rpc === rpcTarget)) {
return null
} else {
return h(
DropdownMenuItem,
{
key: rpc,
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
action: () => props.dispatch(actions.setRpcTarget(rpc)),
onClick: () => props.dispatch(actions.setRpcTarget(rpc)),
},
[
h('i.fa.fa-question-circle.fa-lg.menu-icon'),
rpc,
h('.check', '✓'),
rpcTarget === rpc ? h('.check', '✓') : null,
]
)
}