config: show existing window if already open
This commit is contained in:
parent
0d81eadaf0
commit
be9f15dc45
1 changed files with 9 additions and 2 deletions
|
@ -4,12 +4,19 @@ ipcMain.on('DISCORD_UPDATED_QUOTES', (e, c) => {
|
||||||
if (c === 'o') exports.open();
|
if (c === 'o') exports.open();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let win;
|
||||||
exports.open = () => {
|
exports.open = () => {
|
||||||
const win = require('../utils/win')({
|
if (win) return win.show();
|
||||||
|
|
||||||
|
win = require('../utils/win')({
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 650
|
height: 650
|
||||||
}, 'config');
|
}, 'config');
|
||||||
|
|
||||||
|
win.on('close', () => {
|
||||||
|
win = null;
|
||||||
|
});
|
||||||
|
|
||||||
let config = settings.get('openasar', {});
|
let config = settings.get('openasar', {});
|
||||||
config.setup = true;
|
config.setup = true;
|
||||||
settings.set('openasar', config);
|
settings.set('openasar', config);
|
||||||
|
@ -33,5 +40,5 @@ 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