From 6333e02a394157b5c1bc082fc14e4013b8f8a65e Mon Sep 17 00:00:00 2001 From: Which Node Date: Tue, 13 May 2025 19:35:39 -0600 Subject: [PATCH] Fix balance display for uninitialized accounts --- .../src/modules/core/routes/Account/Account.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/web-app/src/modules/core/routes/Account/Account.tsx b/web-app/src/modules/core/routes/Account/Account.tsx index 6d05d509..a9faa830 100644 --- a/web-app/src/modules/core/routes/Account/Account.tsx +++ b/web-app/src/modules/core/routes/Account/Account.tsx @@ -99,6 +99,7 @@ const Account: FC = ({ accountAddress }) => { // Correct balance display for un-migrated V7 slow wallets: // If it's a slow wallet and not initialized then display unlocked as zero and balance as correct, // add a note that account is not initialized + // Also all uninitialized accounts should be displayed as if they were slow wallets. !account.initialized && (
Note: this account has not been initialized
) } @@ -107,7 +108,7 @@ const Account: FC = ({ accountAddress }) => {
- {account.slowWallet ? <>Unlocked Balance : <>Balance} + {account.slowWallet || !account.initialized ? <>Unlocked Balance : <>Balance}
{account.slowWallet ? ( @@ -117,27 +118,30 @@ const Account: FC = ({ accountAddress }) => { {new Decimal(0)} ) ) : ( - {new Decimal(data.account.balance)} + account.initialized ? ( + {new Decimal(data.account.balance)} + ) : ( + {new Decimal(0)} + ) )}
)} - {data.account.balance && account.slowWallet && ( + {data.account.balance && (account.slowWallet || !account.initialized) && (
Locked
- {account.initialized ? ( + {account.initialized && account.slowWallet ? ( {new Decimal(data.account.balance).minus( new Decimal(account.slowWallet.unlocked), )} - + ) : ( {new Decimal(data.account.balance)} ) - }