diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-02-24 05:56:58 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-02-24 05:56:58 +0800 |
commit | 62854398f1d3c72a82ae9d4feb03d9a1a947534e (patch) | |
tree | 879c6ded10ca1f11bdb7057282ffbc61c01b36e4 /ui | |
parent | 3be6ee5f6cc5e7b79a8eeea182f91a15eb9ed989 (diff) | |
download | tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.gz tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.bz2 tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.lz tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.xz tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.zst tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.zip |
Tested against code to play nice with unit tests.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/actions.js | 18 | ||||
-rw-r--r-- | ui/app/app.js | 4 | ||||
-rw-r--r-- | ui/app/reducers/metamask.js | 3 |
3 files changed, 17 insertions, 8 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 86638fc91..7e5add1d0 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -626,13 +626,19 @@ function markAccountsFound() { // function setRpcTarget (newRpc) { - if (global.METAMASK_DEBUG) console.log(`background.setRpcTarget`) - background.addToFrequentRpcList(newRpc, () => { + return (dispatch) => { + if (global.METAMASK_DEBUG) console.log(`background.setRpcTarget`) background.setRpcTarget(newRpc) - }) - return { - type: actions.SET_RPC_TARGET, - value: newRpc, + background.updateFrequentRpcList(newRpc, (frequentRpcList) => { + const value = { + rpcTarget: newRpc, + frequentRpcList, + } + dispatch({ + type: actions.SET_RPC_TARGET, + value, + }) + }) } } diff --git a/ui/app/app.js b/ui/app/app.js index d61f93dd2..cf865f23f 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -257,7 +257,9 @@ App.prototype.renderNetworkDropdown = function () { h(DropMenuItem, { label: 'Localhost 8545', closeMenu: () => this.setState({ isNetworkMenuOpen: false }), - 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'), activeNetworkRender: props.provider.rpcTarget, }), diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 3875cf6d1..7bf2969e7 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -55,9 +55,10 @@ function reduceMetamask (state, action) { case actions.SET_RPC_TARGET: return extend(metamaskState, { + frequentRpcList: action.value.frequentRpcList, provider: { type: 'rpc', - rpcTarget: action.value, + rpcTarget: action.value.rpcTarget, }, }) |