From 378511a0c745fef0a0cb20b4e00f2bd8bd5f6836 Mon Sep 17 00:00:00 2001 From: David Mark Clements Date: Thu, 11 Jul 2024 20:00:46 +0200 Subject: [PATCH] Desktop - teardown fix (#219) * Desktop - teardown fix * still works, improve later after prod release so CI can handle it --- gui/preload.js | 2 +- preload.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gui/preload.js b/gui/preload.js index 38c2ef773..aaf13fdf7 100644 --- a/gui/preload.js +++ b/gui/preload.js @@ -18,7 +18,7 @@ module.exports = class PearGUI extends ReadyResource { }) const onteardown = async (fn) => { - if (!state.isDecal) return + if (state.isDecal) return await this.ready() const action = await this.ipc.unloading({ id }) // only resolves when unloading occurs await fn() diff --git a/preload.js b/preload.js index bdf90fd95..bcb32bad2 100644 --- a/preload.js +++ b/preload.js @@ -13,7 +13,8 @@ if (process.isMainFrame) { window[Symbol.for('pear.ipcRenderer')] = electron.ipcRenderer const state = JSON.parse(process.argv.slice(isWindows ? -2 : -1)[0]) - const { parentWcId, env, id, decalled = false, isDecal = false, ...config } = state + const { parentWcId, env, id, decalled = false, ...config } = state + const isDecal = state.isDecal || false if (config.key?.type === 'Buffer') config.key = Buffer.from(config.key.data) const dir = config.dir window[Symbol.for('pear.config')] = config