mirror of
https://github.com/element-hq/element-desktop.git
synced 2026-02-05 13:22:18 -05:00
Remove unncessary check
This commit is contained in:
@@ -517,19 +517,17 @@ app.on("ready", async () => {
|
||||
event.preventDefault();
|
||||
|
||||
// Check if the user expects us to minimize to tray instead of quitting the app
|
||||
const shouldMinimize = store.get("minimizeToTray") && (tray.hasTray() || process.platform === "darwin");
|
||||
// Two cases:
|
||||
// 1. On Linux/Windows, user has enabled "Show tray icon and minimise window to it on close" in settings.
|
||||
// 2. On Mac, the canonical behaviour is to minimize to tray; this is not configurable.
|
||||
const shouldMinimize = store.get("minimizeToTray") || process.platform === "darwin";
|
||||
if (shouldMinimize) {
|
||||
// On Mac, closing the window just hides it
|
||||
// (this is generally how single-window Mac apps
|
||||
// behave, eg. Mail.app)
|
||||
|
||||
if (global.mainWindow?.isFullScreen()) {
|
||||
global.mainWindow.once("leave-full-screen", () => global.mainWindow?.hide());
|
||||
global.mainWindow.setFullScreen(false);
|
||||
} else {
|
||||
global.mainWindow?.hide();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user