aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-02-24 05:56:58 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-02-24 05:56:58 +0800
commit62854398f1d3c72a82ae9d4feb03d9a1a947534e (patch)
tree879c6ded10ca1f11bdb7057282ffbc61c01b36e4 /ui/app/actions.js
parent3be6ee5f6cc5e7b79a8eeea182f91a15eb9ed989 (diff)
downloadtangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.gz
tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.tar.zst
tangerine-wallet-browser-62854398f1d3c72a82ae9d4feb03d9a1a947534e.zip
Tested against code to play nice with unit tests.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js18
1 files changed, 12 insertions, 6 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,
+ })
+ })
}
}