From b2ceea2483173f69bc2027fcbf2254d4de1520cb Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sat, 17 May 2025 08:46:26 +0800 Subject: [PATCH] fix: electron-store config.json missing * Added 'electron-store' to the Vite configuration for Electron. * Imported configuration from '@main/config' in the main index file. * Changed default return value for getTrayOnClose method in ConfigManager to false --- src/main/index.ts | 4 +++- src/main/services/ConfigManager.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index fb79b1e842..f85803ed84 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,3 +1,5 @@ +import '@main/config' + import { electronApp, optimizer } from '@electron-toolkit/utils' import { replaceDevtoolsFont } from '@main/utils/windowUtil' import { IpcChannel } from '@shared/IpcChannel' @@ -42,7 +44,7 @@ if (!app.requestSingleInstanceLock()) { } else { // Portable dir must be setup before app ready setUserDataDir() - + // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. diff --git a/src/main/services/ConfigManager.ts b/src/main/services/ConfigManager.ts index 6242709385..bb0cbfc422 100644 --- a/src/main/services/ConfigManager.ts +++ b/src/main/services/ConfigManager.ts @@ -62,7 +62,7 @@ export class ConfigManager { } getTrayOnClose(): boolean { - return !!this.get(ConfigKeys.TrayOnClose, true) + return !!this.get(ConfigKeys.TrayOnClose, false) } setTrayOnClose(value: boolean) {