fix rouge local configs overriding sync config
This commit is contained in:
parent
2ab1d86d92
commit
e202f18720
6 changed files with 48 additions and 36 deletions
|
|
@ -24,29 +24,13 @@ import { useLocalConfigStore } from 'src/stores/local_config.js'
|
|||
|
||||
import { storage } from 'src/lib/storage.js'
|
||||
import {
|
||||
defaultState as configDefaultState,
|
||||
INSTANCE_DEFAULT_CONFIG,
|
||||
INSTANCE_DEFAULT_CONFIG_DEFINITIONS,
|
||||
LOCAL_DEFAULT_CONFIG,
|
||||
LOCAL_DEFAULT_CONFIG_DEFINITIONS,
|
||||
THEME_CONFIG,
|
||||
THEME_CONFIG_DEFINITIONS,
|
||||
ROOT_CONFIG,
|
||||
ROOT_CONFIG_DEFINITIONS,
|
||||
validateSetting,
|
||||
makeUndefined,
|
||||
} from 'src/modules/default_config_state.js'
|
||||
import { oldDefaultConfigSync } from 'src/modules/old_default_config_state.js'
|
||||
|
||||
const ROOT_CONFIG_DEFINITIONS = {
|
||||
...INSTANCE_DEFAULT_CONFIG_DEFINITIONS,
|
||||
...LOCAL_DEFAULT_CONFIG_DEFINITIONS,
|
||||
...THEME_CONFIG_DEFINITIONS,
|
||||
}
|
||||
|
||||
const ROOT_CONFIG = {
|
||||
...INSTANCE_DEFAULT_CONFIG,
|
||||
...LOCAL_DEFAULT_CONFIG,
|
||||
...THEME_CONFIG,
|
||||
}
|
||||
|
||||
export const VERSION = 2
|
||||
export const NEW_USER_DATE = new Date('2026-03-16') // date of writing this, basically
|
||||
|
||||
|
|
@ -69,11 +53,9 @@ export const defaultState = {
|
|||
prefsStorage: {
|
||||
_journal: [],
|
||||
simple: {
|
||||
dontShowUpdateNotifs: false,
|
||||
collapseNav: false,
|
||||
muteFilters: {},
|
||||
|
||||
...configDefaultState,
|
||||
...makeUndefined({ ...ROOT_CONFIG }),
|
||||
},
|
||||
collections: {
|
||||
pinnedStatusActions: ['reply', 'retweet', 'favorite', 'emoji'],
|
||||
|
|
@ -505,7 +487,9 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
|||
)
|
||||
}
|
||||
|
||||
const definition = ROOT_CONFIG_DEFINITIONS[path.split('.')[1]]
|
||||
const definition = path.startsWith('simple.muteFilters')
|
||||
? { default: {} }
|
||||
: ROOT_CONFIG_DEFINITIONS[path.split('.')[1]]
|
||||
|
||||
const finalValue = validateSetting({
|
||||
path: path.split('.')[1],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue