Skip to content

Commit df78185

Browse files
committed
comments
1 parent 0479406 commit df78185

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/src/organisms/ModuleWizardFlows/SelectModule.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,22 @@ export function SelectModule(props: SelectModuleProps): JSX.Element | null {
5858
const { t } = useTranslation('module_wizard_flows')
5959

6060
const { parseModuleUSBPort } = useModuleUSBPort()
61+
// Every module that needs setup (isn't calibrated, isn't in deck config) that also
62+
// CAN be set up with the current robot configuration (pipettes or not pipettes)
6163
const allSetupable = useGetModulesNeedingSetupThatCanCurrentlyBeSetUp()
64+
// Every module that needs setup, but not all are guaranteed to be able to be set up
65+
// right now (e.g. because they need calibration but we don't have a pipette)
6266
const allNeedingSetup = useGetModulesNeedingSetup()
6367
const newModules =
6468
attachedModuleOnLaunch == null ? allSetupable : [attachedModuleOnLaunch]
65-
// allNeedingSetup is a superset of allSetupable
69+
// if there are more modules that need setup than modules that can be set up, then
70+
// it follows that some modules need setup but cannot be set up. in that case we want
71+
// a warning
6672
const hasUnsetupabbleModules = allNeedingSetup.length > allSetupable.length
73+
// And our special short-circuit flows where we never show a menu if there's only one
74+
// entry should be avoided if we have that warning
6775
const isSingleModule = newModules.length === 1 && !hasUnsetupabbleModules
76+
// Unless, of course, we're being invoked by a caller giving us a specific module
6877
const shortCircuitFlow = attachedModuleOnLaunch != null || isSingleModule
6978
const sendIdentifyStacker = useSendIdentifyStacker()
7079

0 commit comments

Comments
 (0)