From bd8428e9ed3e1fb386620def0739720aa8985299 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 18 Sep 2017 16:09:01 -0700 Subject: Comply with current currency API and add additional styling. --- app/scripts/controllers/currency.js | 4 ++-- ui/app/components/fiat-value.js | 2 +- ui/app/config.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js index e32f51ec2..9e696ce55 100644 --- a/app/scripts/controllers/currency.js +++ b/app/scripts/controllers/currency.js @@ -8,7 +8,7 @@ class CurrencyController { constructor (opts = {}) { const initState = extend({ - currentCurrency: 'ethusd', + currentCurrency: 'usd', conversionRate: 0, conversionDate: 'N/A', }, opts.initState) @@ -45,7 +45,7 @@ class CurrencyController { updateConversionRate () { const currentCurrency = this.getCurrentCurrency() - return fetch(`https://api.infura.io/v1/ticker/${currentCurrency}`) + return fetch(`https://api.infura.io/v1/ticker/eth${currentCurrency}`) .then(response => response.json()) .then((parsedResponse) => { this.setConversionRate(Number(parsedResponse.bid)) diff --git a/ui/app/components/fiat-value.js b/ui/app/components/fiat-value.js index 8a64a1cfc..d76b80ab2 100644 --- a/ui/app/components/fiat-value.js +++ b/ui/app/components/fiat-value.js @@ -28,7 +28,7 @@ FiatValue.prototype.render = function () { fiatTooltipNumber = 'Unknown' } - return fiatDisplay(fiatDisplayNumber, currentCurrency) + return fiatDisplay(fiatDisplayNumber, currentCurrency.toUpperCase()) } function fiatDisplay (fiatDisplayNumber, fiatSuffix) { diff --git a/ui/app/config.js b/ui/app/config.js index fbd38c7f4..0fe232c07 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -170,7 +170,7 @@ function currentConversionInformation (metamaskState, state) { }, defaultValue: currentCurrency, }, infuraCurrencies.map((currency) => { - return h('option', {key: currency.symbol, value: currency.symbol}, `${currency.quote.code.toUpperCase()} - ${currency.quote.name}`) + return h('option', {key: currency.quote.code, value: currency.quote.code}, `${currency.quote.code.toUpperCase()} - ${currency.quote.name}`) }) ), ]) -- cgit v1.2.3