embedded: revert accidental/unfinished qjs change

This commit is contained in:
Florian Dold 2023-06-30 23:01:11 +02:00
parent bac2ac01b8
commit 86e9799ffd
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -188,25 +188,21 @@ export function installNativeWalletListener(): void {
const id = msg.id; const id = msg.id;
logger.info(`native listener: got request for ${operation} (${id})`); logger.info(`native listener: got request for ${operation} (${id})`);
if (operation === "anastasisReduce") { let respMsg: CoreApiResponse;
sendNativeMessage(respMsg); try {
} else { respMsg = await handler.handleMessage(operation, id, msg.args ?? {});
let respMsg: CoreApiResponse; } catch (e) {
try { respMsg = {
respMsg = await handler.handleMessage(operation, id, msg.args ?? {}); type: "error",
} catch (e) { id,
respMsg = { operation,
type: "error", error: getErrorDetailFromException(e),
id, };
operation,
error: getErrorDetailFromException(e),
};
}
logger.info(
`native listener: sending back ${respMsg.type} message for operation ${operation} (${id})`,
);
sendNativeMessage(respMsg);
} }
logger.info(
`native listener: sending back ${respMsg.type} message for operation ${operation} (${id})`,
);
sendNativeMessage(respMsg);
}; };
qjsOs.setMessageFromHostHandler((m) => onMessage(m)); qjsOs.setMessageFromHostHandler((m) => onMessage(m));