Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injimob 878 bug fix #1359

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/VC/common/VCUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ export const getFieldValue = (
}
switch (field) {
case 'status':
return <VCVerification wellknown={wellknown} isVerified={props.vc} />;
return (
<VCVerification
wellknown={wellknown}
isVerified={props.credential !== null}
/>
);
case 'idType':
return getIDType(verifiableCredential);
case 'credentialRegistry':
Expand Down
25 changes: 13 additions & 12 deletions machines/VerifiableCredential/VCItemMachine/VCItemActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import {
sendErrorEvent,
getErrorEventData,
} from '../../../shared/telemetry/TelemetryUtils';
import {WalletBindingResponse} from '../VCMetaMachine/vc';

import {ActivityLogEvents} from '../../activityLog';
import {BackupEvents} from '../../backupAndRestore/backup';
import {VcMetaEvents} from '../VCMetaMachine/VCMetaMachine';
import {WalletBindingResponse} from '../VCMetaMachine/vc';

export const VCItemActions = model => {
return {
Expand All @@ -43,7 +44,7 @@ export const VCItemActions = model => {
vcMetadata: context.vcMetadata,
}),
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
requestStoredContext: send(
Expand Down Expand Up @@ -94,7 +95,7 @@ export const VCItemActions = model => {
};
},
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
removeVcMetaDataFromStorage: send(
Expand All @@ -116,7 +117,7 @@ export const VCItemActions = model => {
};
},
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
sendDownloadLimitExpire: send(
Expand All @@ -127,7 +128,7 @@ export const VCItemActions = model => {
};
},
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),

Expand All @@ -140,15 +141,15 @@ export const VCItemActions = model => {
};
},
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
refreshAllVcs: send(
() => ({
type: 'REFRESH_MY_VCS',
}),
{
to: (context: any) => context.serviceRefs.vc,
to: (context: any) => context.serviceRefs.vcMeta,
},
),

Expand All @@ -166,13 +167,13 @@ export const VCItemActions = model => {
sendVcUpdated: send(
(context: any) => VcMetaEvents.VC_METADATA_UPDATED(context.vcMetadata),
{
to: (context: any) => context.serviceRefs.vc,
to: (context: any) => context.serviceRefs.vcMeta,
},
),
sendTamperedVc: send(
(context: any) => VcMetaEvents.TAMPERED_VC(context.vcMetadata),
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
setErrorAsWalletBindingError: assign({
Expand All @@ -196,7 +197,7 @@ export const VCItemActions = model => {
};
},
{
to: (context: any) => context.serviceRefs.vc,
to: (context: any) => context.serviceRefs.vcMeta,
},
),
setWalletBindingResponse: assign({
Expand Down Expand Up @@ -340,7 +341,7 @@ export const VCItemActions = model => {
};
},
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),

Expand All @@ -352,7 +353,7 @@ export const VCItemActions = model => {
};
},
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
sendTelemetryEvents: () => {
Expand Down
16 changes: 8 additions & 8 deletions machines/VerifiableCredential/VCMetaMachine/VCMetaMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ export const vcMetaMachine =
context: model.initialContext,
events: {} as EventFrom<typeof model>,
},
id: 'vc',
id: 'vcMeta',
initial: 'init',
states: {
init: {
on: {
REFRESH_MY_VCS: {
target: '#vc.ready.myVcs.refreshing',
target: '#vcMeta.ready.myVcs.refreshing',
},
},
initial: 'myVcs',
Expand All @@ -103,7 +103,7 @@ export const vcMetaMachine =
on: {
STORE_RESPONSE: {
actions: 'setReceivedVcs',
target: '#vc.ready',
target: '#vcMeta.ready',
},
},
},
Expand Down Expand Up @@ -183,7 +183,7 @@ export const vcMetaMachine =
actions: 'resetWalletBindingSuccess',
},
REFRESH_RECEIVED_VCS: {
target: '#vc.ready.receivedVcs.refreshing',
target: '#vcMeta.ready.receivedVcs.refreshing',
},
TAMPERED_VC: {
actions: 'setTamperedVcs',
Expand All @@ -194,7 +194,7 @@ export const vcMetaMachine =
'removeVcFromInProgressDownlods',
'setDownloadingFailedVcs',
],
target: '#vc.ready.myVcs.refreshing',
target: '#vcMeta.ready.myVcs.refreshing',
},
DELETE_VC: {
target: 'deletingFailedVcs',
Expand All @@ -204,7 +204,7 @@ export const vcMetaMachine =
'removeVcFromInProgressDownlods',
'setVerificationErrorMessage',
],
target: '#vc.ready.myVcs.refreshing',
target: '#vcMeta.ready.myVcs.refreshing',
},
RESET_VERIFY_ERROR: {
actions: 'resetVerificationErrorMessage',
Expand Down Expand Up @@ -239,7 +239,7 @@ export const vcMetaMachine =
entry: ['logTamperedVCsremoved', send('REFRESH_VCS_METADATA')],
on: {
REFRESH_VCS_METADATA: {
target: '#vc.init',
target: '#vcMeta.init',
},
},
},
Expand All @@ -253,7 +253,7 @@ export const vcMetaMachine =
'removeDownloadingFailedVcsFromMyVcs',
'resetDownloadFailedVcs',
],
target: '#vc.ready.myVcs.refreshing',
target: '#vcMeta.ready.myVcs.refreshing',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion screens/Home/MyVcsTabMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const MyVcsTabMachine = model.createMachine(
(_context, event) =>
VcMetaEvents.VC_ADDED(event.response as VCMetadata),
{
to: context => context.serviceRefs.vc,
to: context => context.serviceRefs.vcMeta,
},
),
},
Expand Down
3 changes: 0 additions & 3 deletions shared/vcjs/verifyCredential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ function handleResponse(
errorMessage = VerificationErrorType.TECHNICAL_ERROR;
isVerifiedFlag = false;

console.log('Verification: ', result['results'][0]);
console.log('Verifiable Credential: ', verifiableCredential);

if (errorCodeName == 'jsonld.InvalidUrl') {
errorMessage = VerificationErrorType.NETWORK_ERROR;
} else if (errorCodeName == VerificationErrorType.RANGE_ERROR) {
Expand Down
Loading