mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 05:27:57 -05:00
[INJIMOB-3027] add fallback if display property of credential type is missing (#1832)
Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
@@ -268,7 +268,7 @@ export const getCredentialType = (
|
||||
if (supportedCredentialsWellknown.format === VCFormat.ldp_vc) {
|
||||
const types = supportedCredentialsWellknown.credential_definition
|
||||
.type as string[];
|
||||
return types[1];
|
||||
return types[types.length - 1];
|
||||
} else {
|
||||
return i18n.t('VcDetails:identityCard');
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@ import {displayType} from '../../machines/Issuers/IssuersMachine';
|
||||
import {SvgImage} from '../ui/svg';
|
||||
import {getDisplayObjectForCurrentLanguage} from '../../shared/openId4VCI/Utils';
|
||||
import {CredentialTypes} from '../../machines/VerifiableCredential/VCMetaMachine/vc';
|
||||
import { getCredentialType } from '../VC/common/VCUtils';
|
||||
|
||||
export const CredentialType: React.FC<CredentialTypeProps> = props => {
|
||||
const selectedIssuerDisplayObject = props.item.display?.length
|
||||
? getDisplayObjectForCurrentLanguage(props.item.display)
|
||||
: {};
|
||||
: {name:getCredentialType(props.item)};
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
@@ -40,7 +41,7 @@ export const CredentialType: React.FC<CredentialTypeProps> = props => {
|
||||
<Text
|
||||
testID={`credentialTypeHeading-${props.testID}`}
|
||||
style={Theme.IssuersScreenStyles.issuerHeading}>
|
||||
{selectedIssuerDisplayObject?.name}
|
||||
{selectedIssuerDisplayObject.name as string}
|
||||
</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
|
||||
Reference in New Issue
Block a user