diff options
author | Dan J Miller <danjm.com@gmail.com> | 2018-01-17 04:14:03 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-01-17 04:14:03 +0800 |
commit | d7a1019a2cda83b263b21d35e0f776e8f76d8998 (patch) | |
tree | f835c5e5958e91202e89852ec532c2555c59fc40 /ui/app/actions.js | |
parent | 77eb7b2db692cc40bf5f8e36c5e695e8f82c76ec (diff) | |
download | tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.tar tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.tar.gz tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.tar.bz2 tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.tar.lz tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.tar.xz tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.tar.zst tangerine-wallet-browser-d7a1019a2cda83b263b21d35e0f776e8f76d8998.zip |
Adding one or more tokens sets the selected token before returning the user to the main screen. (#2995)
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 192a73f76..25cb2c23f 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -1,5 +1,6 @@ const abi = require('human-standard-token-abi') const getBuyEthUrl = require('../../app/scripts/lib/buy-eth-url') +const { getTokenAddressFromTokenObject } = require('./util') const ethUtil = require('ethereumjs-util') var actions = { @@ -1094,10 +1095,12 @@ function removeToken (address) { function addTokens (tokens) { return dispatch => { if (Array.isArray(tokens)) { + dispatch(actions.setSelectedToken(getTokenAddressFromTokenObject(tokens[0]))) return Promise.all(tokens.map(({ address, symbol, decimals }) => ( dispatch(addToken(address, symbol, decimals)) ))) } else { + dispatch(actions.setSelectedToken(getTokenAddressFromTokenObject(tokens))) return Promise.all( Object .entries(tokens) |