diff --git a/packages/desktop/src/main/browser-pane.ts b/packages/desktop/src/main/browser-pane.ts index cbb31d21db6..bbffe9bd0cd 100644 --- a/packages/desktop/src/main/browser-pane.ts +++ b/packages/desktop/src/main/browser-pane.ts @@ -148,7 +148,7 @@ export function createBrowserPane() { function publishState(entry: Entry, error?: string) { const state = entry.page?.state() ?? null send(entry, { type: "browser.control.state", state }) - publish(entry, { type: "state", state, error }) + publish(entry, { type: "state", state, ...(error === undefined ? {} : { error }) }) } function create(entry: Entry) { diff --git a/packages/desktop/src/renderer/platform/index.ts b/packages/desktop/src/renderer/platform/index.ts index df665a2ff08..6a2141bd9a6 100644 --- a/packages/desktop/src/renderer/platform/index.ts +++ b/packages/desktop/src/renderer/platform/index.ts @@ -41,7 +41,11 @@ export function createDesktopPlatform( return { setLayout(layout) { if (!closed) - void ready.then(() => api.browserPane.send({ type: "layout", bindingID, layout })).catch(() => undefined) + void ready + .then(() => + api.browserPane.send({ type: "layout", bindingID, ...(layout === undefined ? {} : { layout }) }), + ) + .catch(() => undefined) }, command: (command) => ready.then(() => api.browserPane.request({ type: "command", bindingID, command })), close() {