Skip to content

Commit

Permalink
fix: credential detail screen (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitpadmani-awts authored Apr 12, 2024
1 parent 61ed874 commit 189cefc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/utils/credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { luminanceForHexColor } from './luminance'
export const isValidAnonCredsCredential = (credential: CredentialExchangeRecord) => {
return (
credential &&
(credential.state === CredentialState.OfferReceived || credential.metadata.get(AnonCredsCredentialMetadataKey))
(credential.state === CredentialState.OfferReceived ||
credential.credentials.find(c => c.credentialRecordType !== 'anoncreds'))
)
}

Expand Down Expand Up @@ -36,7 +37,7 @@ export const getCredentialIdentifiers = (credential: CredentialExchangeRecord) =
}

export const isW3CCredential = (credential: CredentialExchangeRecord) => {
return credential && !credential.metadata.get(AnonCredsCredentialMetadataKey)
return credential && credential.credentials.find(c => c.credentialRecordType === 'w3c')
}

export const sanitizeString = (str: string) => {
Expand Down

0 comments on commit 189cefc

Please sign in to comment.