diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-07-12 03:18:44 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-07-12 03:18:44 +0800 |
commit | a670e54973ed1bae20455507a4b3c44e231ba822 (patch) | |
tree | 00300ea3362b7b48be26d6547f89ed4c5bfac597 /ui/app/actions.js | |
parent | c121ac21ec3bed0381e36de7ead1b583a3da148c (diff) | |
parent | f5de16c91174fbbf208e5aef8f542d3bbbb3cb93 (diff) | |
download | tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.gz tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.bz2 tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.lz tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.xz tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.tar.zst tangerine-wallet-browser-a670e54973ed1bae20455507a4b3c44e231ba822.zip |
Merge branch 'nonce-tracker' of https://github.com/MetaMask/metamask-plugin into nonce-tracker
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index b6b5d6eb1..d99291e46 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -121,7 +121,10 @@ var actions = { SET_PROVIDER_TYPE: 'SET_PROVIDER_TYPE', USE_ETHERSCAN_PROVIDER: 'USE_ETHERSCAN_PROVIDER', useEtherscanProvider: useEtherscanProvider, - showConfigPage: showConfigPage, + showConfigPage, + SHOW_ADD_TOKEN_PAGE: 'SHOW_ADD_TOKEN_PAGE', + showAddTokenPage, + addToken, setRpcTarget: setRpcTarget, setDefaultRpcTarget: setDefaultRpcTarget, setProviderType: setProviderType, @@ -627,6 +630,28 @@ function showConfigPage (transitionForward = true) { } } +function showAddTokenPage (transitionForward = true) { + return { + type: actions.SHOW_ADD_TOKEN_PAGE, + value: transitionForward, + } +} + +function addToken (address, symbol, decimals) { + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + background.addToken(address, symbol, decimals, (err) => { + dispatch(actions.hideLoadingIndication()) + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + setTimeout(() => { + dispatch(actions.goHome()) + }, 250) + }) + } +} + function goBackToInitView () { return { type: actions.BACK_TO_INIT_MENU, |