Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[desktop] [macOS] Hide dock icon on Window close

Manav Rathi9d60e980f8a4
diff --git a/desktop/src/main/menu.ts b/desktop/src/main/menu.ts
index 6b007ec9fa..e6f1369bba 100644
--- a/desktop/src/main/menu.ts
+++ b/desktop/src/main/menu.ts
@@ -15,7 +15,18 @@ export const createApplicationMenu = (mainWindow: BrowserWindow) => {
//
// Whenever the menu is redrawn the current value of these variables is used
// to set the checked state for the various settings checkboxes.
- let shouldHideDockIcon = !!userPreferences.get("hideDockIcon");
+ //
+ // Note that if the user has not set a value for this preference (i.e., the
+ // value is `undefined`), we use the default `true`. This is confusing, but
+ // this way we retain the older preference key instead of doing a migration.
+ //
+ // Value | Behaviour
+ // ----------|--------------
+ // undefined | default (hide)
+ // false | show
+ // true | hide
+ //
+ let shouldHideDockIcon = userPreferences.get("hideDockIcon") !== false;
const macOSOnly = (options: MenuItemConstructorOptions[]) =>
process.platform == "darwin" ? options : [];