aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/actions.js8
-rw-r--r--ui/app/components/buy-button-subview.js13
-rw-r--r--ui/app/components/coinbase-form.js2
3 files changed, 13 insertions, 10 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 60b4c6f03..8934299e7 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -1,3 +1,5 @@
+const getBuyEthUrl = require('../../app/scripts/lib/buy-eth-url')
+
var actions = {
_setBackgroundConnection: _setBackgroundConnection,
@@ -833,10 +835,10 @@ function showSendPage () {
}
}
-function buyEth (address, amount) {
+function buyEth (opts) {
return (dispatch) => {
- log.debug(`background.buyEth`)
- background.buyEth(address, amount)
+ const url = getBuyEthUrl(opts)
+ global.platform.openWindow({ url })
dispatch({
type: actions.BUY_ETH,
})
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js
index 2b1675b6d..6810303e1 100644
--- a/ui/app/components/buy-button-subview.js
+++ b/ui/app/components/buy-button-subview.js
@@ -104,7 +104,8 @@ BuyButtonSubview.prototype.render = function () {
}
BuyButtonSubview.prototype.formVersionSubview = function () {
- if (this.props.network === '1') {
+ const network = this.props.network
+ if (network === '1') {
if (this.props.buyView.formView.coinbase) {
return h(CoinbaseForm, this.props)
} else if (this.props.buyView.formView.shapeshift) {
@@ -123,15 +124,15 @@ BuyButtonSubview.prototype.formVersionSubview = function () {
marginBottom: '15px',
},
}, 'In order to access this feature, please switch to the Main Network'),
- ((this.props.network === '3') || (this.props.network === '42')) ? h('h3.text-transform-uppercase', 'or go to the') : null,
- (this.props.network === '3') ? h('button.text-transform-uppercase', {
- onClick: () => this.props.dispatch(actions.buyEth()),
+ ((network === '3') || (network === '42')) ? h('h3.text-transform-uppercase', 'or go to the') : null,
+ (network === '3') ? h('button.text-transform-uppercase', {
+ onClick: () => this.props.dispatch(actions.buyEth({ network })),
style: {
marginTop: '15px',
},
}, 'Ropsten Test Faucet') : null,
- (this.props.network === '42') ? h('button.text-transform-uppercase', {
- onClick: () => this.props.dispatch(actions.buyEth()),
+ (network === '42') ? h('button.text-transform-uppercase', {
+ onClick: () => this.props.dispatch(actions.buyEth({ network })),
style: {
marginTop: '15px',
},
diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js
index 40f5719bb..fd5816a21 100644
--- a/ui/app/components/coinbase-form.js
+++ b/ui/app/components/coinbase-form.js
@@ -112,7 +112,7 @@ CoinbaseForm.prototype.toCoinbase = function () {
var message
if (isValidAddress(address) && isValidAmountforCoinBase(amount).valid) {
- props.dispatch(actions.buyEth(address, props.buyView.amount))
+ props.dispatch(actions.buyEth({ network: '1', address, amount: props.buyView.amount }))
} else if (!isValidAmountforCoinBase(amount).valid) {
message = isValidAmountforCoinBase(amount).message
return props.dispatch(actions.displayWarning(message))