mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-27 00:37:14 +09:00
Use an async arrow function for webui rules
Co-authored-by: Hornwitser <github@hornwitser.no>
This commit is contained in:
1 parent
b2daf26e6c
commit
687a384fe4
1 file changed
+2
-7
@@ -392,15 +392,10 @@ function computeTreeData(
|
|||||||
tooltip={def.description}
|
tooltip={def.description}
|
||||||
valuePropName={def.type === "boolean" ? "checked" : "value"}
|
valuePropName={def.type === "boolean" ? "checked" : "value"}
|
||||||
rules={[{
|
rules={[{
|
||||||
validator: function(_, fieldValue) {
|
validator: async (_, fieldValue) => {
|
||||||
if (def.extendedValidation) {
|
if (def.extendedValidation) {
|
||||||
try {
|
def.extendedValidation(fieldValue, config);
|
||||||
def.extendedValidation(fieldValue, config);
|
|
||||||
} catch (err: any) {
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
|
||||||
},
|
},
|
||||||
}]}
|
}]}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user