Skip to content

Commit

Permalink
PrinterRailSettings: ensure new rail state contains all potential var…
Browse files Browse the repository at this point in the history
…iables
  • Loading branch information
miklschmidt committed Dec 27, 2024
1 parent af59bb3 commit fc6bf31
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/setup-steps/printer-rail-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,18 @@ export const PrinterRailSettings: React.FC<PrinterRailSettingsProps> = (props) =
}, [supportedVoltages, voltage, recommendedPreset]);

useEffect(() => {
const newState = {
const newState: Zod.infer<typeof BasePrinterRail> = {
axis: props.printerRail.axis,
axisDescription: props.printerRail.axisDescription,
rotationDistance: props.printerRail.rotationDistance,
invertStepperDirection: props.printerRail.invertStepperDirection,
axisMinimum: props.printerRail.axisMinimum,
axisMaximum: props.printerRail.axisMaximum,
axisEndstop: props.printerRail.axisEndstop,
homingSpeed: homingSpeed,
motorSlot: motorSlot,
microstepping: props.printerRail.microstepping,
gearRatio: props.printerRail.gearRatio,
driver,
voltage: voltage.id,
stepper,
Expand Down

0 comments on commit fc6bf31

Please sign in to comment.