diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js index 96976b7..2c03529 100644 --- a/src/index.js +++ b/src/index.js @@ -33,7 +33,7 @@ function start() { nodeIntegration: true, contextIsolation: false, }, - }); + }); // when --debug is added it'll open the dev tools if (cli.hasParam("debug")) {win.openDevTools()} @@ -46,9 +46,21 @@ function start() { win.webContents.send(channel, data); }; send = win.send; - ipcMain.on("exit", () => {process.exit(0)}); + ipcMain.on("exit", () => { + if (utils.settings.originkill) { + utils.isOriginRunning().then((running) => { + if (running) { + utils.killOrigin().then(process.exit(0)) + } else { + process.exit(0) + } + }) + } else { + process.exit(0) + } + }); ipcMain.on("minimize", () => {win.minimize()}); - ipcMain.on("relaunch", () => {app.relaunch();app.exit()}); + ipcMain.on("relaunch", () => {app.relaunch(); app.exit()}); // passthrough to renderer from main ipcMain.on("win-log", (event, ...args) => {send("log", ...args)}); |