Skip to content

Commit

Permalink
fix(app): return calibration flow even if pipette is already calibrated
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Feb 15, 2024
1 parent 9dc8f2d commit 01fc7d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/src/organisms/PipetteWizardFlows/getPipetteWizardSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getPipetteWizardSteps = (
mount: PipetteMount,
selectedPipette: SelectablePipettes,
isGantryEmpty: boolean
): PipetteWizardStep[] => {
): PipetteWizardStep[] | null => {
switch (flowType) {
case FLOWS.CALIBRATE: {
return [
Expand Down Expand Up @@ -205,5 +205,5 @@ export const getPipetteWizardSteps = (
}
}
}
return []
return null
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,17 @@ export const getPipetteWizardStepsForProtocol = (
attachedPipettes: AttachedPipettesFromInstrumentsQuery,
pipetteInfo: LoadedPipette[],
mount: Mount
): PipetteWizardStep[] => {
): PipetteWizardStep[] | null => {
const requiredPipette = pipetteInfo.find(pipette => pipette.mount === mount)
const nintySixChannelAttached =
attachedPipettes[LEFT]?.instrumentName === 'p1000_96'

// return empty array when correct pipette is attached && pipette cal not needed or
// no pipette is required in the protocol
if (
(requiredPipette?.pipetteName === attachedPipettes[mount]?.instrumentName &&
attachedPipettes[mount]?.data?.calibratedOffset?.last_modified != null) ||
requiredPipette == null
) {
return []
// return calibration flow only if correct pipette is attached and pipette cal null
// return empty array if no pipette is required in the protocol
if (requiredPipette == null) {
return null
// return calibration flow if correct pipette is attached
} else if (
requiredPipette?.pipetteName === attachedPipettes[mount]?.instrumentName &&
attachedPipettes[mount]?.data?.calibratedOffset?.last_modified == null
requiredPipette?.pipetteName === attachedPipettes[mount]?.instrumentName
) {
return [
{
Expand Down

0 comments on commit 01fc7d7

Please sign in to comment.