diff options
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 7a8d9667d..9edb3511a 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -143,6 +143,8 @@ var actions = { exportAccountComplete, SET_ACCOUNT_LABEL: 'SET_ACCOUNT_LABEL', setAccountLabel, + updateNetworkNonce, + SET_NETWORK_NONCE: 'SET_NETWORK_NONCE', // tx conf screen COMPLETED_TX: 'COMPLETED_TX', TRANSACTION_ERROR: 'TRANSACTION_ERROR', @@ -1483,11 +1485,12 @@ function showAccountDetail (address) { return (dispatch) => { dispatch(actions.showLoadingIndication()) log.debug(`background.setSelectedAddress`) - background.setSelectedAddress(address, (err) => { + background.setSelectedAddress(address, (err, tokens) => { dispatch(actions.hideLoadingIndication()) if (err) { return dispatch(actions.displayWarning(err.message)) } + dispatch(updateTokens(tokens)) dispatch({ type: actions.SHOW_ACCOUNT_DETAIL, value: address, @@ -2115,6 +2118,24 @@ function updateFeatureFlags (updatedFeatureFlags) { } } +function setNetworkNonce (networkNonce) { + return { + type: actions.SET_NETWORK_NONCE, + value: networkNonce, + } +} + +function updateNetworkNonce (address) { + return (dispatch) => { + return new Promise((resolve, reject) => { + global.ethQuery.getTransactionCount(address, (err, data) => { + dispatch(setNetworkNonce(data)) + resolve(data) + }) + }) + } +} + function setMouseUserState (isMouseUser) { return { type: actions.SET_MOUSE_USER_STATE, |