diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-03-08 08:01:51 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-03-08 08:01:51 +0800 |
commit | e7e024bcdd2c93b34a0baf8bc27e6c571c098476 (patch) | |
tree | 26ab0b013f3c10d0db040aeea3baac798e3bb390 /ui/app/actions.js | |
parent | 08ca7dac5a15e104084c6da3eb6015136b316809 (diff) | |
download | tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.gz tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.bz2 tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.lz tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.xz tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.zst tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.zip |
Refactor of code into separate reducers and actions.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 4172ea5df..2fc0d3523 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -674,33 +674,21 @@ function markAccountsFound() { // default rpc target refers to localhost:8545 in this instance. function setDefaultRpcTarget (rpcList) { log.debug(`background.setDefaultRpcTarget`) - background.setRpcTarget('http://localhost:8545') - return (dispatch) => { - dispatch({ - type: actions.SET_RPC_TARGET, - value: 'http://localhost:8545', - }) - dispatch({ - type: actions.SET_RPC_LIST, - value: rpcList, - }) + background.setDefaultRpc() + return { + type: actions.SET_RPC_TARGET, + value: 'http://localhost:8545', } } function setRpcTarget (newRpc) { return (dispatch) => { log.debug(`background.setRpcTarget`) - background.setRpcTarget(newRpc) - background.updateFrequentRpcList(newRpc, (rpcList) => { - dispatch({ - type: actions.SET_RPC_TARGET, - value: newRpc, - }) - dispatch({ - type: actions.SET_RPC_LIST, - value: rpcList, - }) - }) + background.setCustomRpc(newRpc) + return { + type: actions.SET_RPC_TARGET, + value: newRpc, + } } } |