[INJIMOB-3167] add null checks in card view and cache to fix vc render after download (#2049)

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
abhip2565
2025-08-11 15:15:47 +05:30
committed by GitHub
parent 10c7e25c24
commit 40c1446b97
4 changed files with 31 additions and 21 deletions

View File

@@ -76,7 +76,9 @@ export const VCCardView: React.FC<VCItemProps> = ({
vcMetadata.issuerHost,
)
.then(response => {
if(response && response.matchingCredentialIssuerMetadata) {
setWellknown(response.matchingCredentialIssuerMetadata);
}
setFields(response.fields);
})
.catch(error => {
@@ -88,7 +90,7 @@ export const VCCardView: React.FC<VCItemProps> = ({
}
}, [verifiableCredentialData]);
if (!isVCLoaded(controller.credential, fields) || !wellknown || !vc) {
if (!isVCLoaded(controller.credential) || !wellknown || !vc) {
return <VCCardSkeleton />;
}

View File

@@ -456,8 +456,7 @@ export const fieldItemIterator = (
};
export const isVCLoaded = (
verifiableCredential: Credential | null,
fields: string[],
verifiableCredential: Credential | null
) => {
return verifiableCredential != null;
};