diff options
author | 0neGal <mail@0negal.com> | 2022-06-12 16:25:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 16:25:01 +0200 |
commit | d78c28b6b07de0a4a43a484a4c8baf558596b335 (patch) | |
tree | d14f2216ce5f9f71de19caecf9308c7c8bc7c079 /src/index.js | |
parent | 461ad2c4183f47c089f307e21acc0c2316874243 (diff) | |
parent | 0d81e16ccee3ca8afe5a0310fdbe6d708a1424ce (diff) | |
download | Viper-d78c28b6b07de0a4a43a484a4c8baf558596b335.tar.gz Viper-d78c28b6b07de0a4a43a484a4c8baf558596b335.zip |
Merge pull request #133 from pcbmaster/main
feat: Option to close Origin when Viper exits
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)}); |