fix: improve app hiding functionality (#51)

This commit is contained in:
Ryan Cao 2023-07-11 18:57:10 +00:00 committed by GitHub
parent 0415cb77f7
commit 13d87dc85e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -283,10 +283,13 @@ function createMainWindow() {
win.setMenuBarVisibility(false);
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();
win.hide();
if (process.platform === "darwin") app.hide();
else win.hide();
return false;
});