aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2016-07-22 04:41:10 +0800
committerDan Finlay <somniac@me.com>2016-07-22 04:41:10 +0800
commitfcd523abe4c5e8c4da7f176b2fc15578903384b7 (patch)
tree9118133325c282d01f49bc717dacabfd824aa762 /ui/app/actions.js
parent6658bea8d444281491718f8eee7bc3ae42f91b69 (diff)
downloadtangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.tar
tangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.tar.gz
tangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.tar.bz2
tangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.tar.lz
tangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.tar.xz
tangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.tar.zst
tangerine-wallet-browser-fcd523abe4c5e8c4da7f176b2fc15578903384b7.zip
Buy button (#474)
* WIP: Buy button link * Add buy eth and the buy eth warning message * Add css * Move the opening of coinbase page to background and send to faucet if on test net * Create a Warning about storeing eth * Finish Buy button and Eth store warning screen * Add to CHANGELOG * fix frankies deletion and change chrome to extension
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 3e0fe55c0..82a319907 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -66,6 +66,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',
@@ -106,6 +110,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
@@ -559,3 +566,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,
+ })
+ }
+}