add defaults to main settings to sync with renderer

This commit is contained in:
jeffvli
2025-12-28 18:12:14 -08:00
parent 5c399f7117
commit 1aa91fe2f5
2 changed files with 31 additions and 2 deletions
+30 -1
View File
@@ -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<any>({
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');
+1 -1
View File
@@ -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']: {