verify import settings, ignore theme for when it's not needed
This commit is contained in:
parent
19fdc1e74c
commit
ffeda63676
1 changed files with 22 additions and 2 deletions
|
|
@ -13,7 +13,11 @@ import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
import { useSyncConfigStore } from 'src/stores/sync_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 {
|
import {
|
||||||
newExporter,
|
newExporter,
|
||||||
newImporter,
|
newImporter,
|
||||||
|
|
@ -160,10 +164,22 @@ const SettingsModal = {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
useSyncConfigStore().setPreference({
|
const definition = ROOT_CONFIG_DEFINITIONS[entry]
|
||||||
|
|
||||||
|
const finalValue = validateSetting({
|
||||||
path: `simple.${path}`,
|
path: `simple.${path}`,
|
||||||
value,
|
value,
|
||||||
|
definition,
|
||||||
|
throwError: false,
|
||||||
|
defaultState: ROOT_CONFIG,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (finalValue !== undefined) {
|
||||||
|
useSyncConfigStore().setPreference({
|
||||||
|
path: `simple.${path}`,
|
||||||
|
value,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -187,6 +203,10 @@ const SettingsModal = {
|
||||||
'customTheme',
|
'customTheme',
|
||||||
'customThemeSource',
|
'customThemeSource',
|
||||||
'colors',
|
'colors',
|
||||||
|
'style',
|
||||||
|
'styleCustomData',
|
||||||
|
'palette',
|
||||||
|
'paletteCustomData',
|
||||||
])
|
])
|
||||||
sample = Object.fromEntries(
|
sample = Object.fromEntries(
|
||||||
Object.entries(sample).filter(
|
Object.entries(sample).filter(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue