This commit is contained in:
kakkokari-gtyih 2024-11-03 01:40:09 +09:00
parent 1005d17313
commit c27811b490
1 changed files with 6 additions and 3 deletions

View File

@ -194,10 +194,13 @@ async function save() {
typeSafeObjectEntries(clientSettingOverrides.value)
.filter(([key, def]) => (
def.enableOverride &&
def.overrideValue !== def.defaultValue &&
JSON.stringify(def.overrideValue) !== JSON.stringify(def.defaultValue)
def.overrideValue !== def.defaultValue && (
(typeof def.defaultValue === 'string' && typeof def.overrideValue === 'string' && def.overrideValue !== def.defaultValue) ||
(typeof def.defaultValue === 'object' && typeof def.overrideValue === 'string' && JSON.stringify(def.overrideValue) !== JSON.stringify(def.defaultValue)) ||
(typeof def.defaultValue !== 'string' && typeof def.overrideValue === 'string' && def.overrideValue !== JSON.stringify(def.defaultValue))
)
))
.map(([key, def]) => [key, def.overrideValue])
.map(([key, def]) => [key, typeof def.overrideValue === 'string' && typeof def.defaultValue !== 'string' ? JSON.parse(def.overrideValue) : def.overrideValue])
);
let defaultClientSettingOverrides: string | null = JSON.stringify(overrides);