config: ensure window is not destroyed

This commit is contained in:
Ducko 2023-04-03 18:37:40 +01:00
parent be9f15dc45
commit 120d1a5b16

View file

@ -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;
});