mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 19:21:33 +02:00
PrintModal carried a useEffect that reset scheduleOptions.gcodeInjection to false whenever mode === 'create' AND effectiveQuantity <= 1. The comment claimed the checkbox only renders for quantity > 1, but the actual render gate in ScheduleOptions is just hasGcodeSnippets — no quantity check. So with snippets configured + quantity = 1 (the OP scenario): user clicks the checkbox, React updates state to true, the parent's useEffect immediately sees effectiveQuantity <= 1 and resets to false, and the checkbox appears un-clickable. Edit-queue- item mode worked because mode !== 'create' short-circuited the reset. Drop the effectiveQuantity <= 1 clause from the reset. Keep the !settings?.gcode_snippets half as the legitimate cleanup for the "admin removes all snippets while modal is open" case. The scheduler reads item.gcode_injection per queue item regardless of batch size, so single prints can inject too.