Skip to content

Commit

Permalink
Desktop - teardown fix (#219)
Browse files Browse the repository at this point in the history
* Desktop - teardown fix

* still works, improve later after prod release so CI can handle it
  • Loading branch information
davidmarkclements authored Jul 11, 2024
1 parent 65cc176 commit 378511a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gui/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 378511a

Please sign in to comment.