network - use providerType for localhost

feature/default_network_editable
kumavis 7 years ago
parent b2f02300a3
commit 5f1f345a5d
  1. 5
      ui/app/actions.js
  2. 8
      ui/app/components/dropdowns/network-dropdown.js

@ -1300,7 +1300,7 @@ function retryTransaction (txId) {
function setProviderType (type) {
return (dispatch) => {
log.debug(`background.setProviderType`)
log.debug(`background.setProviderType`, type)
background.setProviderType(type, (err, result) => {
if (err) {
log.error(err)
@ -1321,13 +1321,14 @@ function updateProviderType (type) {
}
function setRpcTarget (newRpc) {
log.debug(`background.setRpcTarget: ${newRpc}`)
return (dispatch) => {
log.debug(`background.setRpcTarget: ${newRpc}`)
background.setCustomRpc(newRpc, (err, result) => {
if (err) {
log.error(err)
return dispatch(self.displayWarning('Had a problem changing networks!'))
}
dispatch(actions.setSelectedToken())
})
}
}

@ -203,18 +203,18 @@ NetworkDropdown.prototype.render = function () {
{
key: 'default',
closeMenu: () => this.props.hideNetworkDropdown(),
onClick: () => props.setRpcTarget('http://localhost:8545'),
onClick: () => props.setProviderType('localhost'),
style: dropdownMenuItemStyle,
},
[
activeNetwork === 'http://localhost:8545' ? h('i.fa.fa-check') : h('.network-check__transparent', '✓'),
providerType === 'localhost' ? h('i.fa.fa-check') : h('.network-check__transparent', '✓'),
h(NetworkDropdownIcon, {
isSelected: activeNetwork === 'http://localhost:8545',
isSelected: providerType === 'localhost',
innerBorder: '1px solid #9b9b9b',
}),
h('span.network-name-item', {
style: {
color: activeNetwork === 'http://localhost:8545' ? '#ffffff' : '#9b9b9b',
color: providerType === 'localhost' ? '#ffffff' : '#9b9b9b',
},
}, this.context.t('localhost')),
]

Loading…
Cancel
Save