diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-07-23 02:15:47 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-07-23 02:15:47 +0800 |
commit | 86832e6feb502a3f1de24b81b111addf1f06bea6 (patch) | |
tree | 8f3ac5ce8c1772916d93cf79e7fd7336e3b6a7bc /ui/app/actions.js | |
parent | 22528002e1edef84ade67d5bc30b2580e6542c05 (diff) | |
parent | 0bbfedc2bf21d8c3eec17fef35e93a98a946469e (diff) | |
download | tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.tar tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.tar.gz tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.tar.bz2 tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.tar.lz tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.tar.xz tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.tar.zst tangerine-wallet-browser-86832e6feb502a3f1de24b81b111addf1f06bea6.zip |
Fix merge conflicts. Fix typos. Ensure currency immediately updated on load.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 8bf4d1c30..a5846f0d2 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -68,6 +68,10 @@ var actions = { showPrivateKey: showPrivateKey, SAVE_ACCOUNT_LABEL: 'SAVE_ACCOUNT_LABEL', saveAccountLabel: saveAccountLabel, + AGREE_TO_ETH_WARNING: 'AGREE_TO_ETH_WARNING', + agreeToEthWarning: agreeToEthWarning, + SHOW_ETH_WARNING: 'SHOW_ETH_WARNING', + showEthWarning: showEthWarning, // tx conf screen COMPLETED_TX: 'COMPLETED_TX', TRANSACTION_ERROR: 'TRANSACTION_ERROR', @@ -108,6 +112,9 @@ var actions = { HIDE_LOADING: 'HIDE_LOADING_INDICATION', showLoadingIndication: showLoadingIndication, hideLoadingIndication: hideLoadingIndication, + // buy Eth with coinbase + BUY_ETH: 'BUY_ETH', + buyEth: buyEth, } module.exports = actions @@ -578,3 +585,31 @@ function showSendPage () { type: actions.SHOW_SEND_PAGE, } } + +function agreeToEthWarning () { + return (dispatch) => { + _accountManager.agreeToEthWarning((err) => { + if (err) { + return dispatch(actions.showEthWarning(err.message)) + } + dispatch({ + type: actions.AGREE_TO_ETH_WARNING, + }) + }) + } +} + +function showEthWarning () { + return { + type: actions.SHOW_ETH_WARNING, + } +} + +function buyEth (address, amount) { + return (dispatch) => { + _accountManager.buyEth(address, amount) + dispatch({ + type: actions.BUY_ETH, + }) + } +} |