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

Add fallback to API failure.

This commit is contained in:
Kevin Serrano 2016-08-16 14:07:06 -07:00
parent da2527ddb4
commit 6041ba1ed2
2 changed files with 7 additions and 1 deletions

View File

@ -291,6 +291,8 @@ ConfigManager.prototype.updateConversionRate = function () {
this.setConversionDate(parsedResponse.timestamp)
}).catch((err) => {
console.error('Error in conversion.', err)
this.setConversionPrice('N/A')
this.setConversionDate('N/A')
})
}

View File

@ -59,6 +59,10 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
balance = balanceObj.balance
}
if (fiatNumber !== 'N/A') {
fiatNumber = fiatNumber.toFixed(2)
}
var label = balanceObj.label
return (
@ -109,7 +113,7 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
fontSize: '12px',
color: '#333333',
},
}, `= ${fiatNumber.toFixed(2)}`),
}, `= ${fiatNumber}`),
h('div', {
style: {
color: '#AEAEAE',