diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-05-20 14:04:19 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-05-20 14:04:19 +0800 |
commit | 4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9 (patch) | |
tree | ecc9cfa83e3570fc71389ee1fdfbcd030f416ddb /ui/app/actions.js | |
parent | 713c77db54e7866da169205d7f665c33a4c626e0 (diff) | |
download | tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.tar tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.tar.gz tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.tar.bz2 tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.tar.lz tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.tar.xz tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.tar.zst tangerine-wallet-browser-4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9.zip |
Update designs for Add Token screen
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 2d238b2f8..66a7fdd45 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -275,6 +275,10 @@ var actions = { UPDATE_NETWORK_ENDPOINT_TYPE: 'UPDATE_NETWORK_ENDPOINT_TYPE', retryTransaction, + SET_PENDING_TOKENS: 'SET_PENDING_TOKENS', + CLEAR_PENDING_TOKENS: 'CLEAR_PENDING_TOKENS', + setPendingTokens, + clearPendingTokens, } module.exports = actions @@ -1929,3 +1933,22 @@ function updateNetworkEndpointType (networkEndpointType) { value: networkEndpointType, } } + +function setPendingTokens (pendingTokens) { + const { customToken = {}, selectedTokens = {} } = pendingTokens + const { address, symbol, decimals } = customToken + const tokens = address && symbol && decimals + ? { ...selectedTokens, [address]: { ...customToken, isCustom: true } } + : selectedTokens + + return { + type: actions.SET_PENDING_TOKENS, + payload: tokens, + } +} + +function clearPendingTokens () { + return { + type: actions.CLEAR_PENDING_TOKENS, + } +} |