fix: improve app hiding functionality (#51)
This commit is contained in:
parent
0415cb77f7
commit
13d87dc85e
1 changed files with 5 additions and 2 deletions
|
@ -283,10 +283,13 @@ function createMainWindow() {
|
||||||
win.setMenuBarVisibility(false);
|
win.setMenuBarVisibility(false);
|
||||||
|
|
||||||
win.on("close", e => {
|
win.on("close", e => {
|
||||||
if (isQuitting || Settings.store.minimizeToTray === false || Settings.store.tray === false) return;
|
const useTray = Settings.store.minimizeToTray && Settings.store.tray;
|
||||||
|
if (isQuitting || (process.platform !== "darwin" && !useTray)) return;
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
win.hide();
|
|
||||||
|
if (process.platform === "darwin") app.hide();
|
||||||
|
else win.hide();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue