proper temporary setting + fix appearance stuff using stale data

This commit is contained in:
Henry Jameson 2026-01-23 14:53:22 +02:00
commit ae17911560
2 changed files with 9 additions and 8 deletions

View file

@ -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()
}

View file

@ -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))
}
}
})