Some fixes to config setting

This commit is contained in:
Cooldude2606 committed 2026-03-11 00:28:36 +00:00
1 parent 9d807fc6d6
commit 414ef0bc8b
6 files changed
+28 -19

No files matched your search

@@ -164,7 +164,15 @@ export default function BaseConfigTree(props: BaseConfigTreeProps) {
const [fieldName, prop] = propsMap.get(field)!;
const fieldValue = (fields[fieldName] ?? {}) as Record<string, string>;
fields[fieldName] = fieldValue;
fieldValue[prop] = value ? JSON.parse(value) : undefined;
try {
fieldValue[prop] = value ? JSON.parse(value) : undefined;
} catch (err: any) {
setErrorFields(errors => {
const newErrors = new Map(errors);
newErrors.set(fieldName, err.message);
return newErrors;
});
}
} else {
fields[field] = value === null ? "" : String(value);