mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 15:24:52 +09:00
Some fixes to config setting
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user