mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Simplify empty account balance rendering
This commit is contained in:
parent
c4cbe3ad4c
commit
2c89cd722e
@ -142,7 +142,7 @@ describe('util', function() {
|
|||||||
|
|
||||||
it('when given nothing', function() {
|
it('when given nothing', function() {
|
||||||
var result = util.formatBalance()
|
var result = util.formatBalance()
|
||||||
assert.equal(result, 'None', 'should return "None"')
|
assert.equal(result, '0 ETH', 'should return "0 ETH"')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return eth as string followed by ETH', function() {
|
it('should return eth as string followed by ETH', function() {
|
||||||
|
@ -99,7 +99,7 @@ function formatBalance (balance, decimalsToKeep) {
|
|||||||
var parsed = parseBalance(balance)
|
var parsed = parseBalance(balance)
|
||||||
var beforeDecimal = parsed[0]
|
var beforeDecimal = parsed[0]
|
||||||
var afterDecimal = parsed[1]
|
var afterDecimal = parsed[1]
|
||||||
var formatted = 'None'
|
var formatted = '0 ETH'
|
||||||
if (decimalsToKeep === undefined) {
|
if (decimalsToKeep === undefined) {
|
||||||
if (beforeDecimal === '0') {
|
if (beforeDecimal === '0') {
|
||||||
if (afterDecimal !== '0') {
|
if (afterDecimal !== '0') {
|
||||||
|
Loading…
Reference in New Issue
Block a user