Merge pull request #717 from ajford/spool_edit_weight_iss477

Fix Spool Edit page Empty Weight and Initial Weight bug
This commit is contained in:
Donkie
2026-01-05 22:58:42 +01:00
committed by GitHub

View File

@@ -131,8 +131,8 @@ export const SpoolEdit: React.FC<IResourceComponentsProps> = () => {
const [usedWeight, setUsedWeight] = useState(0); const [usedWeight, setUsedWeight] = useState(0);
useEffect(() => { useEffect(() => {
const newFilamentWeight = selectedFilament?.weight || 0; const newFilamentWeight = getFilamentWeight();
const newSpoolWeight = selectedFilament?.spool_weight || 0; const newSpoolWeight = getSpoolWeight();
if (newFilamentWeight > 0) { if (newFilamentWeight > 0) {
form.setFieldValue("initial_weight", newFilamentWeight); form.setFieldValue("initial_weight", newFilamentWeight);
} }