Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): module calibration should only use calibrated pipette #13956

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/organisms/Devices/InstrumentsAndModules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export function InstrumentsAndModules({
attachedPipettes?.left ?? null
)
const attachPipetteRequired =
attachedLeftPipette == null && attachedRightPipette == null
attachedLeftPipette?.data?.calibratedOffset?.last_modified == null &&
attachedRightPipette?.data?.calibratedOffset?.last_modified == null
const updatePipetteFWRequired =
badLeftPipette != null || badRightPipette != null

Expand Down
12 changes: 10 additions & 2 deletions app/src/organisms/ModuleWizardFlows/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
const isOnDevice = useSelector(getIsOnDevice)
const { t } = useTranslation('module_wizard_flows')
const attachedPipettes = useAttachedPipettesFromInstrumentsQuery()
const attachedPipette = attachedPipettes.left ?? attachedPipettes.right
const attachedPipette =
attachedPipettes.left?.data.calibratedOffset?.last_modified != null
? attachedPipettes.left
: attachedPipettes.right

const moduleCalibrationSteps = getModuleCalibrationSteps()
const availableSlotNames =
FLEX_SLOT_NAMES_BY_MOD_TYPE[getModuleType(attachedModule.moduleModel)] ?? []
Expand Down Expand Up @@ -193,7 +197,11 @@
continuePastCommandFailure
)
}
if (currentStep == null || attachedPipette == null) return null
if (
currentStep == null ||
attachedPipette?.data.calibratedOffset?.last_modified == null
)
return null

Check warning on line 204 in app/src/organisms/ModuleWizardFlows/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/organisms/ModuleWizardFlows/index.tsx#L204

Added line #L204 was not covered by tests
Comment on lines +200 to +204
Copy link
Contributor

@koji koji Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes make sense, but these lines could be higher like right after currentStep(L76) 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really move it much higher because you can't have an early return statement before all of the hooks are called and there are quite a few in the first two hundred lines

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, that totally makes sense. thanks!


const maintenanceRunId =
maintenanceRunData?.data.id != null &&
Expand Down
Loading