diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index a959912c9..729c7eedf 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -251,11 +251,11 @@ export default { return (k, v) => this.$store.dispatch('pushAdminSetting', { path: k, value: v }) default: - return (originalPath, value) => { - const path = `simple.${originalPath}` + return (readPath, value) => { + const writePath = `simple.${readPath}` if (!this.timedApplyMode) { - useSyncConfigStore().setPreference({ path, value }) + useSyncConfigStore().setPreference({ path: writePath, value }) useSyncConfigStore().pushSyncConfig() } else { if (useInterfaceStore().temporaryChangesTimeoutId !== null) { @@ -263,8 +263,9 @@ export default { return } - useSyncConfigStore().setPreference({ path, value }) - const oldValue = get(this.configSource, path) + const oldValue = get(this.configSource, readPath) + + useSyncConfigStore().setPreference({ path: writePath, value }) const confirm = () => { useSyncConfigStore().pushSyncConfig() @@ -272,7 +273,7 @@ export default { } const revert = () => { - useSyncConfigStore().setPreference({ path, value: oldValue }) + useSyncConfigStore().setPreference({ path: writePath, value: oldValue }) useInterfaceStore().clearTemporaryChanges() } diff --git a/src/lib/style.js b/src/lib/style.js index 350b242f5..c2b0bdbd5 100644 --- a/src/lib/style.js +++ b/src/lib/style.js @@ -17,11 +17,11 @@ const APPEARANCE_SETTINGS_KEYS = new Set( export const piniaStylePlugin = ({ store, options }) => { if (store.$id === 'sync_config') { - store.$onAction(({ name, args }) => { + store.$onAction(({ name, args, after }) => { if (name === 'setPreference') { const { path, value } = args[0] if (APPEARANCE_SETTINGS_KEYS.has(path)) { - applyStyleConfig(store.mergedConfig) + after(() => applyStyleConfig(store.mergedConfig)) } } })