diff --git a/src/main/features/core/settings/index.ts b/src/main/features/core/settings/index.ts index 2a3f9e452..6f0d71d81 100644 --- a/src/main/features/core/settings/index.ts +++ b/src/main/features/core/settings/index.ts @@ -3,10 +3,39 @@ import type { TitleTheme } from '/@/shared/types/types'; import { dialog, ipcMain, nativeTheme, OpenDialogOptions, safeStorage } from 'electron'; import Store from 'electron-store'; -export const store = new Store({ +const getFrame = () => { + const isWindows = process.platform === 'win32'; + const isMacOS = process.platform === 'darwin'; + + if (isWindows) { + return 'windows'; + } + + if (isMacOS) { + return 'macOS'; + } + + return 'linux'; +}; + +export const store = new Store({ beforeEachMigration: (_store, context) => { console.log(`settings migrate from ${context.fromVersion} → ${context.toVersion}`); }, + defaults: { + disable_auto_updates: false, + enableNeteaseTranslation: false, + global_media_hotkeys: true, + mediaSession: false, + playbackType: 'web', + should_prompt_accessibility: true, + shown_accessibility_warning: false, + window_enable_tray: true, + window_exit_to_tray: false, + window_minimize_to_tray: false, + window_start_minimized: false, + window_window_bar_style: getFrame(), + }, migrations: { '>=0.21.2': (store) => { store.set('window_bar_style', 'linux'); diff --git a/src/renderer/store/settings.store.ts b/src/renderer/store/settings.store.ts index 2d617cd83..fd899e5f1 100644 --- a/src/renderer/store/settings.store.ts +++ b/src/renderer/store/settings.store.ts @@ -945,7 +945,7 @@ const initialState: SettingsState = { zoomIn: { allowGlobal: true, hotkey: '', isGlobal: false }, zoomOut: { allowGlobal: true, hotkey: '', isGlobal: false }, }, - globalMediaHotkeys: false, + globalMediaHotkeys: true, }, lists: { ['albumDetail']: {