1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Comply with current currency API and add additional styling.

This commit is contained in:
Kevin Serrano 2017-09-18 16:09:01 -07:00
parent 51cebcc173
commit bd8428e9ed
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
3 changed files with 4 additions and 4 deletions

View File

@ -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))

View File

@ -28,7 +28,7 @@ FiatValue.prototype.render = function () {
fiatTooltipNumber = 'Unknown'
}
return fiatDisplay(fiatDisplayNumber, currentCurrency)
return fiatDisplay(fiatDisplayNumber, currentCurrency.toUpperCase())
}
function fiatDisplay (fiatDisplayNumber, fiatSuffix) {

View File

@ -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}`)
})
),
])