Skip to content
Permalink
Browse files

onClose main window

Fixes #584
  • Loading branch information...
Manuel-777 committed Sep 22, 2019
1 parent 0e3f247 commit bec80a23d90ed8e5719eb9051234541fa417cdff
Showing with 6 additions and 6 deletions.
  1. +6 −6 main.js
12 main.js
@@ -460,6 +460,11 @@ function onBackClosed() {
quit();
}

function onMainClose(e) {
hideWindow();
e.preventDefault();
}

function hideWindow() {
if (mainWindow.isVisible()) {
mainWindow.hide();
@@ -593,12 +598,7 @@ function createMainWindow() {
}
});
win.loadURL(`file://${__dirname}/window_main/index.html`);

win.onbeforeunload = e => {
hideWindow();
console.log("No close!");
e.returnValue = false;
};
win.on("close", onMainClose);

let iconPath = path.join(__dirname, "icon-tray.png");
if (process.platform == "linux") {

0 comments on commit bec80a2

Please sign in to comment.
You can’t perform that action at this time.