File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
app/src/organisms/ModuleWizardFlows Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,22 @@ export function SelectModule(props: SelectModuleProps): JSX.Element | null {
58
58
const { t } = useTranslation ( 'module_wizard_flows' )
59
59
60
60
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)
61
63
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)
62
66
const allNeedingSetup = useGetModulesNeedingSetup ( )
63
67
const newModules =
64
68
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
66
72
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
67
75
const isSingleModule = newModules . length === 1 && ! hasUnsetupabbleModules
76
+ // Unless, of course, we're being invoked by a caller giving us a specific module
68
77
const shortCircuitFlow = attachedModuleOnLaunch != null || isSingleModule
69
78
const sendIdentifyStacker = useSendIdentifyStacker ( )
70
79
You can’t perform that action at this time.
0 commit comments