Merge pull request #136 from MetaMask/ChangeRpcButton

Add new rpc save button to config view
feature/default_network_editable
Dan Finlay 9 years ago
commit 5aa1dba83f
  1. 3
      CHANGELOG.md
  2. 36
      ui/app/config.js

@ -7,6 +7,9 @@
- Added transaction list to account detail view. - Added transaction list to account detail view.
- Fix bug on config screen where current RPC address was always displayed wrong. - Fix bug on config screen where current RPC address was always displayed wrong.
- Fixed bug where entering a decimal value when sending a transaction would result in sending the wrong amount. - Fixed bug where entering a decimal value when sending a transaction would result in sending the wrong amount.
- Add save button to custom RPC input field.
- Add quick-select button for RPC on `localhost:8545`.
- Improve config view styling.
- Users have been migrated from old test-net RPC to a newer test-net RPC. - Users have been migrated from old test-net RPC to a newer test-net RPC.
# 1.5.1 2016-04-15 # 1.5.1 2016-04-15

@ -47,11 +47,14 @@ ConfigScreen.prototype.render = function() {
currentProviderDisplay(metamaskState), currentProviderDisplay(metamaskState),
h('div', [ h('div', { style: {display: 'flex'} }, [
h('input', { h('input#new_rpc', {
placeholder: 'New RPC URL', placeholder: 'New RPC URL',
style: { style: {
width: '100%', width: 'inherit',
flex: '1 0 auto',
height: '30px',
margin: '8px',
}, },
onKeyPress(event) { onKeyPress(event) {
if (event.key === 'Enter') { if (event.key === 'Enter') {
@ -61,6 +64,17 @@ ConfigScreen.prototype.render = function() {
} }
} }
}), }),
h('button', {
style: {
alignSelf: 'center',
},
onClick(event) {
event.preventDefault()
var element = document.querySelector('input#new_rpc')
var newRpc = element.value
state.dispatch(actions.setRpcTarget(newRpc))
}
}, 'Save')
]), ]),
h('div', [ h('div', [
@ -87,6 +101,18 @@ ConfigScreen.prototype.render = function() {
}, 'Use Morden Test Network') }, 'Use Morden Test Network')
]), ]),
h('div', [
h('button', {
style: {
alignSelf: 'center',
},
onClick(event) {
event.preventDefault()
state.dispatch(actions.setRpcTarget('http://localhost:8545/'))
}
}, 'Use http://localhost:8545')
]),
]), ]),
]), ]),
]) ])
@ -96,7 +122,7 @@ ConfigScreen.prototype.render = function() {
function currentProviderDisplay(metamaskState) { function currentProviderDisplay(metamaskState) {
var rpc = metamaskState.provider.rpcTarget var rpc = metamaskState.provider.rpcTarget
return h('div', [ return h('div', [
h('h3', {style: { fontWeight: 'bold' }}, 'Currently using RPC'), h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current RPC'),
h('p', rpc) h('span', rpc)
]) ])
} }

Loading…
Cancel
Save