Skip to content

Commit

Permalink
fix disposal field
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Dec 12, 2024
1 parent b0c8e69 commit 6185bd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
const labwares = useSelector(getLabwareEntities)
const pipettes = useSelector(getPipetteEntities)
const addFieldNamePrefix = makeAddFieldNamePrefix(tab)

const isWasteChuteSelected =
propsForFields.dispense_labware?.value != null
? additionalEquipmentEntities[
Expand All @@ -98,11 +97,15 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
additionalEquipmentEntities[String(propsForFields.dispense_labware.value)]
?.name === 'trashBin'

const destinationLabwareType = getTrashOrLabware(
labwares,
additionalEquipmentEntities,
formData.dispense_labware as string
)
const destinationLabwareType =
formData.dispense_labware != null
? getTrashOrLabware(
labwares,
additionalEquipmentEntities,
formData.dispense_labware as string
)
: null

const isDestinationTrash =
destinationLabwareType != null
? ['trashBin', 'wasteChute'].includes(destinationLabwareType)
Expand Down Expand Up @@ -134,12 +137,12 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {

const mappedErrorsToField = getFormErrorsMappedToField(visibleFormErrors)

// auto-collapse blowout field if disposal volume is checked
useEffect(() => {
if (formData.disposalVolume_checkbox) {
propsForFields.blowout_checkbox.updateValue(false)
}
}, [formData.disposalVolume_checkbox])
// auto-collapse blowout field if disposal volume is not null
// useEffect(() => {
// if (formData.disposalVolume_checkbox) {
// propsForFields.blowout_checkbox.updateValue(false)
// }
// }, [formData.disposalVolume_checkbox])

return toolboxStep === 0 ? (
<Flex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ const updatePatchDisposalVolumeFields = (
...patch,
disposalVolume_checkbox: true,
disposalVolume_volume: recommendedMinimumDisposalVol,
blowout_checkbox: false,
}
}

Expand Down

0 comments on commit 6185bd5

Please sign in to comment.