Skip to content

Commit

Permalink
Merge pull request #193 from Sphereon-Opensource/fix/MWALL-701
Browse files Browse the repository at this point in the history
fix: fixed dispactchVerifiableCredential function
  • Loading branch information
nklomp authored Jul 15, 2024
2 parents 892fc24 + 8b41a9c commit 32ad8b4
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 132 deletions.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@
"@sphereon/ssi-sdk-ext.key-manager": "0.22.0",
"@sphereon/ssi-sdk-ext.key-utils": "0.22.0",
"@sphereon/ssi-sdk-ext.kms-local": "0.22.0",
"@sphereon/ssi-sdk.contact-manager": "0.26.1-next.132",
"@sphereon/ssi-sdk.core": "0.26.1-next.132",
"@sphereon/ssi-sdk.data-store": "0.26.1-next.132",
"@sphereon/ssi-sdk.event-logger": "0.26.1-next.132",
"@sphereon/ssi-sdk.issuance-branding": "0.26.1-next.132",
"@sphereon/ssi-sdk.oid4vci-holder": "0.26.1-next.132",
"@sphereon/ssi-sdk.sd-jwt": "0.26.1-next.132",
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.26.1-next.132",
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.26.1-next.132",
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.26.1-next.132",
"@sphereon/ssi-types": "0.26.1-next.132",
"@sphereon/ui-components.core": "0.2.1-next.49",
"@sphereon/ui-components.ssi-react-native": "0.2.1-next.49",
"@sphereon/ui-components.credential-branding": "0.2.1-next.49",
"@sphereon/ssi-sdk.contact-manager": "0.26.1-next.140",
"@sphereon/ssi-sdk.core": "0.26.1-next.140",
"@sphereon/ssi-sdk.data-store": "0.26.1-next.140",
"@sphereon/ssi-sdk.event-logger": "0.26.1-next.140",
"@sphereon/ssi-sdk.issuance-branding": "0.26.1-next.140",
"@sphereon/ssi-sdk.oid4vci-holder": "0.26.1-next.140",
"@sphereon/ssi-sdk.sd-jwt": "0.26.1-next.140",
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.26.1-next.140",
"@sphereon/ssi-sdk.vc-handler-ld-local": "0.26.1-next.140",
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.26.1-next.140",
"@sphereon/ssi-types": "0.26.1-next.140",
"@sphereon/ui-components.core": "0.2.1-next.72",
"@sphereon/ui-components.ssi-react-native": "0.2.1-next.72",
"@sphereon/ui-components.credential-branding": "0.2.1-next.72",
"@veramo/core": "4.2.0",
"@veramo/credential-w3c": "4.2.0",
"@veramo/data-store": "4.2.0",
Expand Down
9 changes: 5 additions & 4 deletions src/store/actions/credential.actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ICredentialBranding} from '@sphereon/ssi-sdk.data-store';
import {ICredentialBranding, Party} from '@sphereon/ssi-sdk.data-store';
import {CredentialMapper, OriginalVerifiableCredential} from '@sphereon/ssi-types';
import {ICreateVerifiableCredentialArgs, UniqueVerifiableCredential, VerifiableCredential} from '@veramo/core';
import {Action} from 'redux';
Expand Down Expand Up @@ -81,9 +81,10 @@ export const dispatchVerifiableCredential = (
dispatch({type: CREDENTIALS_LOADING});
const mappedVc: VerifiableCredential = CredentialMapper.toUniformCredential(vc as OriginalVerifiableCredential) as VerifiableCredential;
ibGetCredentialBranding({filter: [{vcHash: credentialHash}]})
.then((credentialBranding: Array<ICredentialBranding>) =>
toCredentialSummary({verifiableCredential: mappedVc, hash: credentialHash}, credentialBranding?.[0]?.localeBranding),
)
.then((credentialBranding: Array<ICredentialBranding>) => {
const issuer: Party | undefined = getCredentialIssuerContact(mappedVc);
return toCredentialSummary({verifiableCredential: mappedVc, hash: credentialHash}, credentialBranding?.[0]?.localeBranding, issuer);
})
.then((summary: CredentialSummary): void => {
dispatch({
type: STORE_CREDENTIAL_SUCCESS,
Expand Down
Loading

0 comments on commit 32ad8b4

Please sign in to comment.