Browse Source

Display totals as free + reserved

Jaco Greeff 4 years ago
parent
commit
efef8e8834

+ 1 - 1
packages/page-accounts/src/Accounts/Account.tsx

@@ -103,7 +103,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
 
   useEffect((): void => {
     if (balancesAll) {
-      setBalance(address, balancesAll.freeBalance);
+      setBalance(address, balancesAll.freeBalance.add(balancesAll.reservedBalance));
       api.api.tx.vesting?.vest && setVestingTx(() =>
         balancesAll.vestingLocked.isZero()
           ? null

+ 2 - 2
packages/react-components/src/AddressInfo.tsx

@@ -241,7 +241,7 @@ function renderBalances (props: Props, allAccounts: string[], t: <T = string> (k
           <Label label={t<string>('total')} />
           <FormatBalance
             className='result'
-            value={balancesAll.votingBalance}
+            value={balancesAll.freeBalance.add(balancesAll.reservedBalance)}
           />
         </>
       )}
@@ -361,7 +361,7 @@ function renderBalances (props: Props, allAccounts: string[], t: <T = string> (k
   if (withBalanceToggle) {
     return (
       <>
-        <Expander summary={<FormatBalance value={balancesAll?.votingBalance} />}>
+        <Expander summary={<FormatBalance value={balancesAll && balancesAll.freeBalance.add(balancesAll.reservedBalance)} />}>
           <div className='body column'>
             {allItems}
           </div>