From 120d1a5b16ee64b2ab4173f91502235b73bee89f Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Mon, 3 Apr 2023 18:37:40 +0100 Subject: [PATCH] config: ensure window is not destroyed --- src/config/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/index.js b/src/config/index.js index cbce815..713e5cf 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -6,14 +6,14 @@ ipcMain.on('DISCORD_UPDATED_QUOTES', (e, c) => { let win; exports.open = () => { - if (win) return win.show(); + if (win && !win.isDestroyed()) return win.show(); win = require('../utils/win')({ width: 500, height: 650 }, 'config'); - win.on('close', () => { + win.on('closed', () => { win = null; }); @@ -41,4 +41,4 @@ exports.open = () => { ipcMain.on('of', () => { shell.openPath(require('../paths').getUserData() + '/settings.json') }); -}; +}; \ No newline at end of file