feat(settings): add silent startup to tray

This commit is contained in:
Jason
2026-04-25 17:41:19 +08:00
parent 2acbe0fb08
commit 42d4982728
4 changed files with 92 additions and 20 deletions

View File

@@ -15,6 +15,7 @@ export const CONFIG_KEYS = {
WINDOW_BOUNDS: 'windowBounds',
CACHE_PATH: 'cachePath',
LAUNCH_AT_STARTUP: 'launchAtStartup',
SILENT_STARTUP: 'silentStartup',
EXPORT_PATH: 'exportPath',
AGREEMENT_ACCEPTED: 'agreementAccepted',
@@ -321,6 +322,17 @@ export async function setLaunchAtStartup(enabled: boolean): Promise<void> {
await config.set(CONFIG_KEYS.LAUNCH_AT_STARTUP, enabled)
}
// 获取静默启动偏好
export async function getSilentStartup(): Promise<boolean> {
const value = await config.get(CONFIG_KEYS.SILENT_STARTUP)
return value === true
}
// 设置静默启动偏好
export async function setSilentStartup(enabled: boolean): Promise<void> {
await config.set(CONFIG_KEYS.SILENT_STARTUP, enabled)
}
// 获取 LLM 模型路径
export async function getLlmModelPath(): Promise<string | null> {
const value = await config.get(CONFIG_KEYS.LLM_MODEL_PATH)