@@ -18,8 +18,8 @@ import Tour from './tour';
18
18
import TradeInfoPanel from './TradeInfoPanel' ;
19
19
import { showDialog } from '../bot/tools' ;
20
20
import Elevio from '../../common/elevio' ;
21
- import { updateConfigCurrencies } from '../common/const' ;
22
- import { roundBalance , isVirtual } from '../common/tools' ;
21
+ import config , { updateConfigCurrencies } from '../common/const' ;
22
+ import { isVirtual } from '../common/tools' ;
23
23
import {
24
24
logoutAllTokens ,
25
25
getOAuthURL ,
@@ -66,8 +66,16 @@ api.events.on('balance', response => {
66
66
balance : { balance : b , currency } ,
67
67
} = response ;
68
68
69
- const balance = ( + roundBalance ( { currency, balance : b } ) ) . toLocaleString ( getLanguage ( ) . replace ( '_' , '-' ) ) ;
70
- $ ( '.topMenuBalance' ) . text ( `${ balance } ${ currency } ` ) ;
69
+ const elTopMenuBalances = document . querySelectorAll ( '.topMenuBalance' ) ;
70
+ const localString = getLanguage ( ) . replace ( '_' , '-' ) ;
71
+ const balance = ( + b ) . toLocaleString ( localString , {
72
+ minimumFractionDigits : config . lists . CRYPTO_CURRENCIES . includes ( currency ) ? 8 : 2 ,
73
+ } ) ;
74
+
75
+ elTopMenuBalances . forEach ( elTopMenuBalance => {
76
+ const element = elTopMenuBalance ;
77
+ element . textContent = `${ balance } ${ currency } ` ;
78
+ } ) ;
71
79
} ) ;
72
80
73
81
const addBalanceForToken = token => {
0 commit comments