1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 10:30:04 +01:00

Default currency-display valueToRender to empty string when not readOnly ('0' if readOnly).

This commit is contained in:
Dan 2018-06-02 01:58:01 -02:30
parent 1b879f45bc
commit ffd42c59da

View File

@ -49,8 +49,8 @@ CurrencyDisplay.prototype.getAmount = function (value) {
: toHexWei(value)
}
CurrencyDisplay.prototype.getValueToRender = function ({ selectedToken, conversionRate, value }) {
if (value === '0x0') return '0'
CurrencyDisplay.prototype.getValueToRender = function ({ selectedToken, conversionRate, value, readOnly }) {
if (value === '0x0') return readOnly ? '0' : ''
const { decimals, symbol } = selectedToken || {}
const multiplier = Math.pow(10, Number(decimals || 0))