From ffeda63676dadf20c4d455c2497f582c838f1278 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 5 Apr 2026 13:12:24 +0300 Subject: [PATCH] verify import settings, ignore theme for when it's not needed --- .../settings_modal/settings_modal.js | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js index 4ca2857b2..2c1ba5563 100644 --- a/src/components/settings_modal/settings_modal.js +++ b/src/components/settings_modal/settings_modal.js @@ -13,7 +13,11 @@ import { useLocalConfigStore } from 'src/stores/local_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' -import { LOCAL_ONLY_KEYS } from 'src/modules/default_config_state.js' +import { + LOCAL_ONLY_KEYS, + ROOT_CONFIG, + ROOT_CONFIG_DEFINITIONS, +} from 'src/modules/default_config_state.js' import { newExporter, newImporter, @@ -160,10 +164,22 @@ const SettingsModal = { }) }) } else { - useSyncConfigStore().setPreference({ + const definition = ROOT_CONFIG_DEFINITIONS[entry] + + const finalValue = validateSetting({ path: `simple.${path}`, value, + definition, + throwError: false, + defaultState: ROOT_CONFIG, }) + + if (finalValue !== undefined) { + useSyncConfigStore().setPreference({ + path: `simple.${path}`, + value, + }) + } } } }) @@ -187,6 +203,10 @@ const SettingsModal = { 'customTheme', 'customThemeSource', 'colors', + 'style', + 'styleCustomData', + 'palette', + 'paletteCustomData', ]) sample = Object.fromEntries( Object.entries(sample).filter(