Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vc fixed rendering #1888

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/gui/src/components/vcs/VCList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
useLazyGetProofsForRootQuery,
useVCCoinAdded,
} from '@chia-network/api-react';
import { Flex, More, MenuItem, AlertDialog, useOpenDialog, useDarkMode } from '@chia-network/core';
import { Flex, More, MenuItem, AlertDialog, Loading, useOpenDialog, useDarkMode } from '@chia-network/core';
import {
VCZeroStateBackground as VCZeroStateBackgroundIcon,
VCZeroStateBackgroundDark as VCZeroStateBackgroundDarkIcon,
Expand Down Expand Up @@ -149,7 +149,9 @@ export default function VCList() {
return [];
}, [VCsLocalStorage, blockchainVCs?.vcRecords, fingerprint, proofs]);

if (isLoading) return null;
if (isLoading) {
return <Loading center />;
}

const allVCsSortLatest = sortByTimestamp
? allVCs.sort((a: any, b: any) => {
Expand Down Expand Up @@ -300,7 +302,7 @@ export default function VCList() {
);
}

if (allVCsSortLatest.length === 0) {
if (!allVCsSortLatest?.length) {
return renderZeroState();
}

Expand All @@ -313,7 +315,7 @@ export default function VCList() {
<Flex sx={{ justifyContent: 'space-between', marginBottom: '10px', padding: '15px' }}>
<Flex>
<Typography variant="h6">
<Trans>Verifiable Credentials</Trans>: {allVCs.length}
<Trans>Verifiable Credentials</Trans>: {allVCs?.length ?? 0}
</Typography>
</Flex>
{renderActionsDropdown()}
Expand Down