mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 05:27:57 -05:00
[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:
@@ -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 />;
|
||||
}
|
||||
|
||||
|
||||
@@ -456,8 +456,7 @@ export const fieldItemIterator = (
|
||||
};
|
||||
|
||||
export const isVCLoaded = (
|
||||
verifiableCredential: Credential | null,
|
||||
fields: string[],
|
||||
verifiableCredential: Credential | null
|
||||
) => {
|
||||
return verifiableCredential != null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user