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(protocol-designer): fix bug with selecting magnet > disengage step #5257

Merged
merged 1 commit into from
Mar 23, 2020
Merged
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
7 changes: 6 additions & 1 deletion protocol-designer/src/ui/steps/actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const selectStep = (
}

// auto-select magnetic module if it exists (assumes no more than 1 magnetic module)
if (formData && formData.stepType === 'magnet') {
if (newStepType === 'magnet') {
const moduleId = uiModulesSelectors.getSingleMagneticModuleId(state)
const magnetAction = getNextDefaultMagnetAction(
stepFormSelectors.getSavedStepForms(state),
Expand All @@ -166,6 +166,11 @@ export const selectStep = (
// recommended value is null when no labware found on module
const engageHeight = prevEngageHeight || stringDefaultEngageHeight
formData = { ...formData, moduleId, magnetAction, engageHeight }
} else if (formData?.stepType === 'magnet') {
// handle case for pristine-never-saved Magnet step:
// it needs the moduleId field populated, bc that field has no UI
const moduleId = uiModulesSelectors.getSingleMagneticModuleId(state)
formData = { ...formData, moduleId }
}

dispatch({
Expand Down