Skip to content

Commit

Permalink
Update SentryWallet counter to use assigned wallet counter
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbartnik committed Jan 15, 2024
1 parent b40b712 commit 81b3662
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apps/sentry-client-desktop/src/features/home/SentryWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export function SentryWallet() {


function getWalletCounter() {
const uniqueWallets: Set<string> = new Set();
let totalKeyLength: number = 0;

new Map([...nodeLicenseStatusMap].filter(([, status]) => {
Expand All @@ -167,18 +166,17 @@ export function SentryWallet() {
}
return status.ownerPublicKey === selectedWallet;
}))
.forEach((status, key) => {
uniqueWallets.add(status.ownerPublicKey);
.forEach((_, key) => {
totalKeyLength += key.toString().length;
});

return (
<>
{uniqueWallets.size > 0
{owners.length > 0
? (loading
? ("Loading...")
: (`${totalKeyLength} key${totalKeyLength === 1 ? '' : 's'} in ${uniqueWallets.size} wallet${uniqueWallets.size === 1 ? '' : 's'}`))
: ("Allowed wallets not assigned")}
: (`${totalKeyLength} key${totalKeyLength === 1 ? '' : 's'} in ${owners.length} wallet${owners.length === 1 ? '' : 's'}`))
: ("No keys")}
</>
);

Expand Down

0 comments on commit 81b3662

Please sign in to comment.