From 69752f1809ee78963704a8bc8671e58dc33f9551 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 10 Apr 2026 01:09:33 +0300 Subject: [PATCH] lint --- src/modules/default_config_state.js | 12 +++++++++--- src/stores/sync_config.js | 28 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/modules/default_config_state.js b/src/modules/default_config_state.js index ff43e4dee..ee3716a38 100644 --- a/src/modules/default_config_state.js +++ b/src/modules/default_config_state.js @@ -688,7 +688,7 @@ export const SYNC_DEFAULT_CONFIG_DEFINITIONS = { description: 'Object containing mute filters', type: 'object', default: {}, - } + }, } export const SYNC_DEFAULT_CONFIG = convertDefinitions( SYNC_DEFAULT_CONFIG_DEFINITIONS, @@ -764,8 +764,14 @@ export const validateSetting = ({ validateObjects = true, }) => { const path = fullPath.replace(/^simple./, '') - if (validateObjects && definition.type === 'object' && path.split('.').length <= 1) { - console.error(`attempt to set object ${fullPath} instead of its children. ignoring.`) + if ( + validateObjects && + definition.type === 'object' && + path.split('.').length <= 1 + ) { + console.error( + `attempt to set object ${fullPath} instead of its children. ignoring.`, + ) return undefined } diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index bad0a1515..d7422d0a9 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -777,21 +777,21 @@ export const useSyncConfigStore = defineStore('sync_config', { afterLoad(state) { console.debug('Validating persisted state of SyncConfig') const newState = { ...state } - const newEntries = Object.entries(ROOT_CONFIG).map( - ([path, value]) => { - const definition = ROOT_CONFIG_DEFINITIONS[path] - const finalValue = validateSetting({ - path, - value: newState.prefsStorage.simple[path], - definition, - throwError: false, - validateObjects: false, - defaultState: ROOT_CONFIG, - }) + const newEntries = Object.entries(ROOT_CONFIG).map(([path, value]) => { + const definition = ROOT_CONFIG_DEFINITIONS[path] + const finalValue = validateSetting({ + path, + value: newState.prefsStorage.simple[path], + definition, + throwError: false, + validateObjects: false, + defaultState: ROOT_CONFIG, + }) - return finalValue === undefined ? definition.default : [path, finalValue] - }, - ) + return finalValue === undefined + ? definition.default + : [path, finalValue] + }) newState.prefsStorage.simple = Object.fromEntries( newEntries.filter((_) => _), )