fix modified indicator for local settings
This commit is contained in:
parent
8ee71cdfff
commit
b8557bb678
3 changed files with 17 additions and 2 deletions
|
|
@ -322,8 +322,9 @@ export default {
|
|||
switch (this.realSource) {
|
||||
case 'profile':
|
||||
return {}
|
||||
default:
|
||||
return get(useInstanceStore().prefsStorage, this.path)
|
||||
default: {
|
||||
return get(useSyncConfigStore().mergedConfigDefault, this.path)
|
||||
}
|
||||
}
|
||||
},
|
||||
isProfileSetting() {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { defineStore } from 'pinia'
|
|||
import { instanceDefaultProperties } from '../modules/config.js'
|
||||
import {
|
||||
instanceDefaultConfig,
|
||||
defaultConfigLocal,
|
||||
staticOrApiConfigDefault,
|
||||
} from '../modules/default_config_state.js'
|
||||
import apiService from '../services/api/api.service.js'
|
||||
|
|
@ -55,6 +56,7 @@ const defaultState = {
|
|||
// Instance admins can override default settings for the whole instance
|
||||
prefsStorage: {
|
||||
...instanceDefaultConfig,
|
||||
...defaultConfigLocal,
|
||||
},
|
||||
|
||||
// Known domains list for user's domain-muting
|
||||
|
|
|
|||
|
|
@ -758,6 +758,18 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
|||
)
|
||||
return result
|
||||
},
|
||||
mergedConfigDefault: (state) => {
|
||||
const instancePrefs = useInstanceStore().prefsStorage
|
||||
const result = Object.fromEntries(
|
||||
Object.entries(state.prefsStorage.simple).map(([k, value]) => [
|
||||
k,
|
||||
LOCAL_ONLY_KEYS.has(k)
|
||||
? (instancePrefs[k] ?? defaultConfigLocal[k])
|
||||
: (instancePrefs[k] ?? instanceDefaultConfig[k]),
|
||||
]),
|
||||
)
|
||||
return result
|
||||
},
|
||||
mergedConfigWithoutDefaults: (state) => {
|
||||
const localPrefs = useLocalConfigStore().prefsStorage
|
||||
const result = Object.fromEntries(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue