Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
do not limit use of buy widget when using custom ADDFUNDS_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
mrose17 committed Nov 15, 2016
1 parent d323edb commit d89d29c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,13 +988,17 @@ var updateLedgerInfo = () => {
underscore.extend(ledgerInfo,
underscore.pick(info, [ 'address', 'passphrase', 'balance', 'unconfirmed', 'satoshis', 'btc', 'amount',
'currency' ]))
if ((!info.buyURLExpires) || (info.buyURLExpires > now)) ledgerInfo.buyURL = info.buyURL
if ((process.env.NODE_ENV === 'development') && (typeof process.env.ADDFUNDS_URL !== 'undefined')) {
if ((!info.buyURLExpires) || (info.buyURLExpires > now)) {
ledgerInfo.buyURL = info.buyURL
ledgerInfo.buyMaximumUSD = 6
}
if (typeof process.env.ADDFUNDS_URL !== 'undefined') {
ledgerInfo.buyURLFrame = true
ledgerInfo.buyURL = process.env.ADDFUNDS_URL + '?' +
querystring.stringify({ currency: ledgerInfo.currency,
amount: getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT),
address: ledgerInfo.address })
ledgerInfo.buyMaximumUSD = false
}

underscore.extend(ledgerInfo, ledgerInfo._internal.cache || {})
Expand Down
4 changes: 3 additions & 1 deletion js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ class BitcoinDashboard extends ImmutableComponent {
return getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT, this.props.settings) || 0
}
get canUseCoinbase () {
return this.currency === 'USD' && this.amount < 6
if (!this.props.ledgerData.get('buyMaximumUSD')) return true

return this.currency === 'USD' && this.amount < this.props.ledgerData.get('buyMaximumUSD')
}
get userInAmerica () {
const countryCode = this.props.ledgerData.get('countryCode')
Expand Down

0 comments on commit d89d29c

Please sign in to comment.