mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add defaults to main settings to sync with renderer
This commit is contained in:
@@ -3,10 +3,39 @@ import type { TitleTheme } from '/@/shared/types/types';
|
|||||||
import { dialog, ipcMain, nativeTheme, OpenDialogOptions, safeStorage } from 'electron';
|
import { dialog, ipcMain, nativeTheme, OpenDialogOptions, safeStorage } from 'electron';
|
||||||
import Store from 'electron-store';
|
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) => {
|
beforeEachMigration: (_store, context) => {
|
||||||
console.log(`settings migrate from ${context.fromVersion} → ${context.toVersion}`);
|
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: {
|
migrations: {
|
||||||
'>=0.21.2': (store) => {
|
'>=0.21.2': (store) => {
|
||||||
store.set('window_bar_style', 'linux');
|
store.set('window_bar_style', 'linux');
|
||||||
|
|||||||
@@ -945,7 +945,7 @@ const initialState: SettingsState = {
|
|||||||
zoomIn: { allowGlobal: true, hotkey: '', isGlobal: false },
|
zoomIn: { allowGlobal: true, hotkey: '', isGlobal: false },
|
||||||
zoomOut: { allowGlobal: true, hotkey: '', isGlobal: false },
|
zoomOut: { allowGlobal: true, hotkey: '', isGlobal: false },
|
||||||
},
|
},
|
||||||
globalMediaHotkeys: false,
|
globalMediaHotkeys: true,
|
||||||
},
|
},
|
||||||
lists: {
|
lists: {
|
||||||
['albumDetail']: {
|
['albumDetail']: {
|
||||||
|
|||||||
Reference in New Issue
Block a user