aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-08 08:01:51 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-08 08:01:51 +0800
commite7e024bcdd2c93b34a0baf8bc27e6c571c098476 (patch)
tree26ab0b013f3c10d0db040aeea3baac798e3bb390 /ui
parent08ca7dac5a15e104084c6da3eb6015136b316809 (diff)
downloadtangerine-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')
-rw-r--r--ui/app/actions.js30
-rw-r--r--ui/app/reducers/metamask.js1
2 files changed, 10 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,
+ }
}
}
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index c09556c91..a3c07d977 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -18,6 +18,7 @@ function reduceMetamask (state, action) {
conversionDate: 'N/A',
noActiveNotices: true,
lastUnreadNotice: undefined,
+ frequentRpcList: [],
}, state.metamask)
switch (action.type) {