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:
parent
da2527ddb4
commit
6041ba1ed2
@ -291,6 +291,8 @@ ConfigManager.prototype.updateConversionRate = function () {
|
|||||||
this.setConversionDate(parsedResponse.timestamp)
|
this.setConversionDate(parsedResponse.timestamp)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error('Error in conversion.', err)
|
console.error('Error in conversion.', err)
|
||||||
|
this.setConversionPrice('N/A')
|
||||||
|
this.setConversionDate('N/A')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,10 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
|
|||||||
balance = balanceObj.balance
|
balance = balanceObj.balance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fiatNumber !== 'N/A') {
|
||||||
|
fiatNumber = fiatNumber.toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
var label = balanceObj.label
|
var label = balanceObj.label
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -109,7 +113,7 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) {
|
|||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
},
|
},
|
||||||
}, `= ${fiatNumber.toFixed(2)}`),
|
}, `= ${fiatNumber}`),
|
||||||
h('div', {
|
h('div', {
|
||||||
style: {
|
style: {
|
||||||
color: '#AEAEAE',
|
color: '#AEAEAE',
|
||||||
|
Loading…
Reference in New Issue
Block a user