aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-05-01 01:37:09 +0800
committerGitHub <noreply@github.com>2018-05-01 01:37:09 +0800
commitf7ea5bf7935ace7693e620a15d66a0c51982b488 (patch)
tree78e469d86e484a2b2a1f18f2319cf75db6e6c979
parent2601aa594e9d708a9484f51d5d3e2f1ec6d25a3c (diff)
parentb4b33b57bcbdc2f1c8572efb0d98cbe6b86eee39 (diff)
downloadtangerine-wallet-browser-f7ea5bf7935ace7693e620a15d66a0c51982b488.tar.gz
tangerine-wallet-browser-f7ea5bf7935ace7693e620a15d66a0c51982b488.tar.zst
tangerine-wallet-browser-f7ea5bf7935ace7693e620a15d66a0c51982b488.zip
Merge pull request #4121 from MetaMask/i3688-shapeshift-500s
Fix ShapeShift purchases
-rw-r--r--old-ui/app/components/shapeshift-form.js2
-rw-r--r--ui/app/components/shapeshift-form.js13
2 files changed, 8 insertions, 7 deletions
diff --git a/old-ui/app/components/shapeshift-form.js b/old-ui/app/components/shapeshift-form.js
index a54987c04..97068db0a 100644
--- a/old-ui/app/components/shapeshift-form.js
+++ b/old-ui/app/components/shapeshift-form.js
@@ -138,7 +138,7 @@ ShapeshiftForm.prototype.renderMain = function () {
width: '229px',
height: '82px',
},
- }, this.props.warning)
+ }, this.props.warning + '')
: this.renderInfo(),
this.renderRefundAddressForCoin(coin),
diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js
index fd4a80a4a..22ab64426 100644
--- a/ui/app/components/shapeshift-form.js
+++ b/ui/app/components/shapeshift-form.js
@@ -55,6 +55,10 @@ function ShapeshiftForm () {
}
}
+ShapeshiftForm.prototype.getCoinPair = function () {
+ return `${this.state.depositCoin.toUpperCase()}_ETH`
+}
+
ShapeshiftForm.prototype.componentWillMount = function () {
this.props.shapeShiftSubview()
}
@@ -120,14 +124,12 @@ ShapeshiftForm.prototype.renderMetadata = function (label, value) {
}
ShapeshiftForm.prototype.renderMarketInfo = function () {
- const { depositCoin } = this.state
- const coinPair = `${depositCoin}_eth`
const { tokenExchangeRates } = this.props
const {
limit,
rate,
minimum,
- } = tokenExchangeRates[coinPair] || {}
+ } = tokenExchangeRates[this.getCoinPair()] || {}
return h('div.shapeshift-form__metadata', {}, [
@@ -172,10 +174,9 @@ ShapeshiftForm.prototype.renderQrCode = function () {
ShapeshiftForm.prototype.render = function () {
const { coinOptions, btnClass, warning } = this.props
- const { depositCoin, errorMessage, showQrCode, depositAddress } = this.state
- const coinPair = `${depositCoin}_eth`
+ const { errorMessage, showQrCode, depositAddress } = this.state
const { tokenExchangeRates } = this.props
- const token = tokenExchangeRates[coinPair]
+ const token = tokenExchangeRates[this.getCoinPair()]
return h('div.shapeshift-form-wrapper', [
showQrCode