From 43cfc7da884c67532df6ad3658394b27ef431bca Mon Sep 17 00:00:00 2001 From: nickreynolds Date: Thu, 12 Oct 2023 03:01:44 -0400 Subject: [PATCH] fix: correclty save brainshare index (#182) --- packages/agent-explore/src/context/web3/saveMessageHandler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/agent-explore/src/context/web3/saveMessageHandler.ts b/packages/agent-explore/src/context/web3/saveMessageHandler.ts index eb98a12..29c030c 100644 --- a/packages/agent-explore/src/context/web3/saveMessageHandler.ts +++ b/packages/agent-explore/src/context/web3/saveMessageHandler.ts @@ -20,8 +20,10 @@ export class SaveMessageHandler extends AbstractMessageHandler { // console.log('message received: ', message) if (message.type === 'veramo.io-chat-v1') { await context.agent.dataStoreSaveMessage({ message }) - } else if (message.type === 'https://veramo.io/didcomm/brainshare/1.0/return-index' || message.type === 'https://veramo.io/didcomm/brainshare/1.0/return-credential') { + } else if (message.type === 'https://veramo.io/didcomm/brainshare/1.0/return-credential') { await context.agent.dataStoreSaveVerifiableCredential({ verifiableCredential: message.data.credential }) + } else if (message.type === 'https://veramo.io/didcomm/brainshare/1.0/return-index') { + await context.agent.dataStoreSaveVerifiableCredential({ verifiableCredential: message.data.index }) } return super.handle(message, context) }