1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +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) : toHexWei(value)
} }
CurrencyDisplay.prototype.getValueToRender = function ({ selectedToken, conversionRate, value }) { CurrencyDisplay.prototype.getValueToRender = function ({ selectedToken, conversionRate, value, readOnly }) {
if (value === '0x0') return '0' if (value === '0x0') return readOnly ? '0' : ''
const { decimals, symbol } = selectedToken || {} const { decimals, symbol } = selectedToken || {}
const multiplier = Math.pow(10, Number(decimals || 0)) const multiplier = Math.pow(10, Number(decimals || 0))