config: ensure window is not destroyed
This commit is contained in:
parent
be9f15dc45
commit
120d1a5b16
1 changed files with 3 additions and 3 deletions
|
@ -6,14 +6,14 @@ ipcMain.on('DISCORD_UPDATED_QUOTES', (e, c) => {
|
||||||
|
|
||||||
let win;
|
let win;
|
||||||
exports.open = () => {
|
exports.open = () => {
|
||||||
if (win) return win.show();
|
if (win && !win.isDestroyed()) return win.show();
|
||||||
|
|
||||||
win = require('../utils/win')({
|
win = require('../utils/win')({
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 650
|
height: 650
|
||||||
}, 'config');
|
}, 'config');
|
||||||
|
|
||||||
win.on('close', () => {
|
win.on('closed', () => {
|
||||||
win = null;
|
win = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -41,4 +41,4 @@ exports.open = () => {
|
||||||
ipcMain.on('of', () => {
|
ipcMain.on('of', () => {
|
||||||
shell.openPath(require('../paths').getUserData() + '/settings.json')
|
shell.openPath(require('../paths').getUserData() + '/settings.json')
|
||||||
});
|
});
|
||||||
};
|
};
|
Loading…
Reference in a new issue