Skip to content

Commit

Permalink
fix: ensure better compat to old vs new api (blib-la#197)
Browse files Browse the repository at this point in the history
## Motivation

<!-- List motivation and changes here -->

## Issues closed

<!-- List closed issues here -->
  • Loading branch information
pixelass committed Apr 11, 2024
1 parent c6895e5 commit 5f15b06
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/electron/future/ipc/sdk.ts
Expand Up @@ -58,7 +58,10 @@ ipcMain.on(
APP_MESSAGE_KEY,
async (
event,
{ message, appId }: { message: SDKMessage<{ stablefast?: boolean }>; appId: string }
{
message,
appId = message.payload?.appId,
}: { message: SDKMessage<{ stablefast?: boolean; appId: string }>; appId: string }
) => {
if (message.action !== "livePainting:start") {
return;
Expand Down Expand Up @@ -96,6 +99,7 @@ ipcMain.on(
];

if (!message.payload.stablefast) {
console.log("livePainting disable stablefast");
scriptArguments.push("--disable_stablefast");
}

Expand Down Expand Up @@ -173,16 +177,16 @@ ipcMain.on(
});
}
} catch {
logger.info(`livePatinting: Received non-JSON data: ${dataString}`);
logger.info(`livePainting: Received non-JSON data: ${dataString}`);
console.log("Received non-JSON data:", dataString);
}
});

logger.info(`livePatinting: processing stderr`);
logger.info(`livePainting: processing stderr`);
process_.stderr.on("livePainting:data", data => {
console.error(`error: ${data}`);

logger.info(`livePatinting: error: ${data}`);
logger.info(`livePainting: error: ${data}`);

event.sender.send(channel, { action: "livePainting:error", payload: data });
});
Expand Down

0 comments on commit 5f15b06

Please sign in to comment.