Skip to content

Commit 2243f33

Browse files
authored
Merge pull request #13 from whichnode/render-v8-account-status
Render un-initialized accounts
2 parents f366462 + 5d9bf3e commit 2243f33

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

web-app/src/modules/core/routes/Account/Account.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ const Account: FC<Props> = ({ accountAddress }) => {
9494
</div>
9595
}
9696
>
97+
98+
// Correct balance display for un-migrated V7 slow wallets:
99+
// 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
97100
<div className="grid grid-cols-12 gap-4">
98101
{data.account.balance !== null && (
99102
<div className="col-span-12 md:col-span-3 mt-5 gap-5">
@@ -103,7 +106,11 @@ const Account: FC<Props> = ({ accountAddress }) => {
103106
</dt>
104107
<dd className="mt-1 md:text-2xl font-semibold tracking-tight text-gray-900">
105108
{account.slowWallet ? (
106-
<LibraAmount>{new Decimal(account.slowWallet.unlocked)}</LibraAmount>
109+
account.initialized ? (
110+
<LibraAmount>{new Decimal(account.slowWallet.unlocked)}</LibraAmount>
111+
) : (
112+
<LibraAmount>{new Decimal(0)}</LibraAmount>
113+
)
107114
) : (
108115
<LibraAmount>{new Decimal(data.account.balance)}</LibraAmount>
109116
)}
@@ -116,11 +123,17 @@ const Account: FC<Props> = ({ accountAddress }) => {
116123
<div className="overflow-hidden rounded-lg bg-white px-4 py-5 shadow sm:p-6">
117124
<dt className="truncate text-sm font-medium text-gray-500">Locked</dt>
118125
<dd className="mt-1 text-3xl font-semibold tracking-tight text-gray-900">
126+
{account.initialized ? (
119127
<LibraAmount>
120-
{new Decimal(data.account.balance).minus(
121-
new Decimal(account.slowWallet.unlocked),
122-
)}
123-
</LibraAmount>
128+
{new Decimal(data.account.balance).minus(
129+
new Decimal(account.slowWallet.unlocked),
130+
)}
131+
</LibraAmount>
132+
) : (
133+
<LibraAmount>{new Decimal(data.account.balance)}</LibraAmount>
134+
)
135+
136+
}
124137
</dd>
125138
</div>
126139
</div>

web-app/src/modules/interface/Account.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export interface IAccountInfo {
22
account: {
33
address: string;
44
balance: string | null;
5+
initialized: boolean;
56
slowWallet: {
67
unlocked: string;
78
} | null;

0 commit comments

Comments
 (0)