fix: improve app hiding functionality

This commit is contained in:
Ryan Cao 2023-07-09 15:42:54 +08:00
parent b4da701080
commit 5fed84c04d
No known key found for this signature in database

View file

@ -274,10 +274,17 @@ function createMainWindow() {
win.setMenuBarVisibility(false);
win.on("close", e => {
if (isQuitting || Settings.store.minimizeToTray === false || Settings.store.tray === false) return;
if (
isQuitting ||
(process.platform !== "darwin" &&
(Settings.store.minimizeToTray === false || Settings.store.tray === false))
)
return;
e.preventDefault();
win.hide();
if (process.platform === "darwin") app.hide();
else win.hide();
return false;
});