Minor fix to spool weight editing
This commit is contained in:
@@ -73,9 +73,7 @@ export const SpoolEdit: React.FC<IResourceComponentsProps> = () => {
|
|||||||
|
|
||||||
const weightChange = (weight: number) => {
|
const weightChange = (weight: number) => {
|
||||||
setUsedWeight(weight);
|
setUsedWeight(weight);
|
||||||
form.setFieldsValue({
|
form.setFieldValue("used_weight", weight);
|
||||||
used_weight: weight,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const locations = useSpoolmanLocations(true);
|
const locations = useSpoolmanLocations(true);
|
||||||
@@ -91,10 +89,10 @@ export const SpoolEdit: React.FC<IResourceComponentsProps> = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (formProps.initialValues && usedWeight != formProps.initialValues["used_weight"]) {
|
if (formProps.initialValues) {
|
||||||
setUsedWeight(formProps.initialValues["used_weight"]);
|
setUsedWeight(formProps.initialValues["used_weight"]);
|
||||||
}
|
}
|
||||||
}, [formProps.initialValues, usedWeight]);
|
}, [formProps.initialValues]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Edit saveButtonProps={saveButtonProps}>
|
<Edit saveButtonProps={saveButtonProps}>
|
||||||
|
|||||||
Reference in New Issue
Block a user