Browse Source

Classic GUI balance update

PascalCoin 6 years ago
parent
commit
7a5125fd91
2 changed files with 6 additions and 5 deletions
  1. 4 3
      src/gui-classic/UFRMWallet.pas
  2. 2 2
      src/gui-classic/UGridUtils.pas

+ 4 - 3
src/gui-classic/UFRMWallet.pas

@@ -2049,9 +2049,10 @@ begin
     exit;
   end;
   LApplyfilter := (cbFilterAccounts.Checked) and ((FMinAccountBalance>0) Or ((FMaxAccountBalance<CT_MaxWalletAmount) and (FMaxAccountBalance>=0)));
-  if (Not cbExploreMyAccounts.Checked) And (not LApplyfilter) then
-    FAccountsGrid.AccountsGridDatasource := acds_Node
-  else begin
+  if (Not cbExploreMyAccounts.Checked) And (not LApplyfilter) then begin
+    FAccountsGrid.AccountsGridDatasource := acds_Node;
+    FAccountsGrid.UpdateData;
+  end else begin
     LFilters := FAccountsGrid.AccountsGridFilter;
     LFilters.MinBalance := FMinAccountBalance;
     LFilters.MaxBalance := FMaxAccountBalance;

+ 2 - 2
src/gui-classic/UGridUtils.pas

@@ -811,11 +811,11 @@ procedure TAccountsGrid.UpdateAccountsBalance;
 var i : Integer;
   LAcc : TAccount;
 begin
-  if Assigned(Node) and (AccountsGridDatasource=acds_InternalList) then begin
-    FAccountsBalance := 0;
+  if Assigned(Node) then begin
     case FAccountsGridDatasource of
       acds_Node: FAccountsBalance := Node.Bank.SafeBox.TotalBalance;
       acds_InternalList: begin
+        FAccountsBalance := 0;
         for i := 0 to FAccountsList.Count - 1 do begin
           LAcc := Node.Bank.SafeBox.Account( FAccountsList.Get(i) );
           inc(FAccountsBalance, LAcc.balance);