minimize exported settings

This commit is contained in:
Henry Jameson 2026-04-05 13:17:36 +03:00
commit 2c6df0887f
2 changed files with 5 additions and 3 deletions

View file

@ -200,6 +200,7 @@ const SettingsModal = {
let sample = config let sample = config
if (!theme) { if (!theme) {
const ignoreList = new Set([ const ignoreList = new Set([
'theme',
'customTheme', 'customTheme',
'customThemeSource', 'customThemeSource',
'colors', 'colors',
@ -207,7 +208,9 @@ const SettingsModal = {
'styleCustomData', 'styleCustomData',
'palette', 'palette',
'paletteCustomData', 'paletteCustomData',
'themeChecksum',
]) ])
sample = Object.fromEntries( sample = Object.fromEntries(
Object.entries(sample).filter( Object.entries(sample).filter(
([key, value]) => !ignoreList.has(key) && value !== undefined, ([key, value]) => !ignoreList.has(key) && value !== undefined,

View file

@ -50,16 +50,15 @@ export const useMergedConfigStore = defineStore('merged_config', {
return result return result
}, },
mergedConfigWithoutDefaults: () => { mergedConfigWithoutDefaults: () => {
const instancePrefs = useInstanceStore().prefsStorage
const tempPrefs = useLocalConfigStore().tempStorage const tempPrefs = useLocalConfigStore().tempStorage
const localPrefs = useLocalConfigStore().prefsStorage const localPrefs = useLocalConfigStore().prefsStorage
const syncPrefs = useSyncConfigStore().prefsStorage const syncPrefs = useSyncConfigStore().prefsStorage
const getValue = (k) => const getValue = (k) =>
tempPrefs[k] ?? localPrefs[k] ?? syncPrefs.simple[k] ?? instancePrefs[k] tempPrefs[k] ?? localPrefs[k] ?? syncPrefs.simple[k]
const result = Object.fromEntries( const result = Object.fromEntries(
Object.keys(ROOT_CONFIG).map(([k, value]) => [k, getValue(k)]), Object.keys(ROOT_CONFIG).map((k) => [k, getValue(k)]),
) )
return result return result
}, },