Skip to content

Commit

Permalink
fix: update without React-style
Browse files Browse the repository at this point in the history
  • Loading branch information
lotharking committed Dec 19, 2024
1 parent 410adfa commit daeecf3
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions packages/main/src/controllers/message/MessageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,21 @@ export class MessageService {
credential.getTag('anonCredsRevocationRegistryId') &&
credential.getTag('anonCredsCredentialRevocationId'),
)
isRevoke &&
(await agent.modules.anoncreds.updateRevocationStatusList({
revocationStatusList: {
revocationRegistryDefinitionId: credential.getTag(
'anonCredsRevocationRegistryId',
) as string,
revokedCredentialIndexes: [Number(credential.getTag('anonCredsCredentialRevocationId'))],
},
options: {},
}))

isRevoke &&
(await agent.credentials.sendRevocationNotification({
credentialRecordId: credential.id,
revocationFormat: 'anoncreds',
revocationId: `${credential.getTag('anonCredsRevocationRegistryId')}::${credential.getTag('anonCredsCredentialRevocationId')}`,
}))
if (!isRevocable) throw new Error(`Credential for threadId ${msg.threadId} is not revocable)`)

await agent.modules.anoncreds.updateRevocationStatusList({
revocationStatusList: {
revocationRegistryDefinitionId: credential.getTag('anonCredsRevocationRegistryId') as string,
revokedCredentialIndexes: [Number(credential.getTag('anonCredsCredentialRevocationId'))],
},
options: {},
})

await agent.credentials.sendRevocationNotification({
credentialRecordId: credential.id,
revocationFormat: 'anoncreds',
revocationId: `${credential.getTag('anonCredsRevocationRegistryId')}::${credential.getTag('anonCredsCredentialRevocationId')}`,
})
}
} else {
throw new Error(`No credentials were found for connection: ${msg.connectionId}.`)
Expand Down

0 comments on commit daeecf3

Please sign in to comment.