diff --git a/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts b/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts index e40486135dc..752a6629386 100644 --- a/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts +++ b/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts @@ -514,10 +514,10 @@ const updatePatchOnPipetteChannelChange = ( const multiToSingle = (prevChannels === 8 || prevChannels === 96) && nextChannels === 1 + const pipetteId: string = appliedPatch.pipette as string + if (patch.pipette === null || singleToMulti) { // reset all well selection - // @ts-expect-error(sa, 2021-6-14): appliedPatch.pipette does not exist. Address in #3161 - const pipetteId: string = appliedPatch.pipette update = { aspirate_wells: getDefaultWells({ // @ts-expect-error(sa, 2021-6-14): appliedPatch.aspirate_labware does not exist. Address in #3161 @@ -545,18 +545,27 @@ const updatePatchOnPipetteChannelChange = ( const sourceLabware = labwareEntities[sourceLabwareId] const sourceLabwareDef = sourceLabware.def const destLabware = labwareEntities[destLabwareId] - const destLabwareDef = destLabware.def + update = { aspirate_wells: getAllWellsFromPrimaryWells( appliedPatch.aspirate_wells as string[], sourceLabwareDef, channels as 8 | 96 ), - dispense_wells: getAllWellsFromPrimaryWells( - appliedPatch.dispense_wells as string[], - destLabwareDef, - channels as 8 | 96 - ), + dispense_wells: + destLabwareId.includes('trashBin') || + destLabwareId.includes('wasteChute') + ? getDefaultWells({ + labwareId: destLabwareId, + pipetteId, + labwareEntities, + pipetteEntities, + }) + : getAllWellsFromPrimaryWells( + appliedPatch.dispense_wells as string[], + destLabware.def, + channels as 8 | 96 + ), } }