diff --git a/src/extension/extension-client/message-handler/ToExtensionMessageHandler.ts b/src/extension/extension-client/message-handler/ToExtensionMessageHandler.ts index 6709470..10828ff 100644 --- a/src/extension/extension-client/message-handler/ToExtensionMessageHandler.ts +++ b/src/extension/extension-client/message-handler/ToExtensionMessageHandler.ts @@ -36,6 +36,10 @@ export class ToExtensionMessageHandler extends MessageHandler { beaconConnected: boolean ): Promise { logger.log('ToExtensionMessageHandler') + + const deserialized: BeaconMessage = (await new Serializer().deserialize(data.payload as string)) as BeaconMessage + this.client.pendingRequests.push({ message: deserialized, connectionContext }) + // TODO: Decide where to send the request to // Use a map and check all known addresses // We can only do this for the operation and the sign request @@ -48,9 +52,6 @@ export class ToExtensionMessageHandler extends MessageHandler { await this.client.popupManager.startPopup() - const deserialized: BeaconMessage = (await new Serializer().deserialize(data.payload as string)) as BeaconMessage - this.client.pendingRequests.push({ message: deserialized, connectionContext }) - const enriched: To = await to(this.enrichRequest(deserialized)) const sendError: (error: Error, errorType: BeaconErrorType) => Promise = async (