aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/index.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-03-29 18:19:39 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-16 00:54:56 +0200
commita35d560f8d1ca414e3ba387b50731ca099e2da47 (patch)
tree5a8a90345c04eb0b69ea3fca8185641e26905b5d /packages/main/src/index.ts
parentfeat: New window banner (diff)
downloadsophie-a35d560f8d1ca414e3ba387b50731ca099e2da47.tar.gz
sophie-a35d560f8d1ca414e3ba387b50731ca099e2da47.tar.zst
sophie-a35d560f8d1ca414e3ba387b50731ca099e2da47.zip
feat: Add custom menubar
The menu is populated reactive from the store with no caching. This doesn't seem to cause any performance problems so far. Currently the menu is electron-specific. In the future, we'll need a more runtime-independent way to build the menu. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main/src/index.ts')
-rw-r--r--packages/main/src/index.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts
index 869c555..29a8cca 100644
--- a/packages/main/src/index.ts
+++ b/packages/main/src/index.ts
@@ -19,7 +19,7 @@
19 * SPDX-License-Identifier: AGPL-3.0-only 19 * SPDX-License-Identifier: AGPL-3.0-only
20 */ 20 */
21 21
22import { arch } from 'node:os'; 22import os from 'node:os';
23 23
24import { app } from 'electron'; 24import { app } from 'electron';
25import { ensureDirSync } from 'fs-extra'; 25import { ensureDirSync } from 'fs-extra';
@@ -68,7 +68,7 @@ app.setAboutPanelOptions({
68 `Chrome: ${process.versions.chrome}`, 68 `Chrome: ${process.versions.chrome}`,
69 `Node.js: ${process.versions.node}`, 69 `Node.js: ${process.versions.node}`,
70 `Platform: ${osName()}`, 70 `Platform: ${osName()}`,
71 `Arch: ${arch()}`, 71 `Arch: ${os.arch()}`,
72 `Build date: ${new Date( 72 `Build date: ${new Date(
73 Number(import.meta.env.BUILD_DATE), 73 Number(import.meta.env.BUILD_DATE),
74 ).toLocaleString()}`, 74 ).toLocaleString()}`,
@@ -90,7 +90,9 @@ app.on('window-all-closed', () => {
90 } 90 }
91}); 91});
92 92
93initReactions(store, isDevelopment) 93const isMac = os.platform() === 'darwin';
94
95initReactions(store, isDevelopment, isMac)
94 // eslint-disable-next-line promise/always-return -- `then` instead of top-level await. 96 // eslint-disable-next-line promise/always-return -- `then` instead of top-level await.
95 .then((disposeCompositionRoot) => { 97 .then((disposeCompositionRoot) => {
96 app.on('will-quit', disposeCompositionRoot); 98 app.on('will-quit', disposeCompositionRoot);