From 80f1427440f7328d59f86c7bac0b5fdc0a58e125 Mon Sep 17 00:00:00 2001 From: Jethary Date: Fri, 17 Jan 2025 09:12:21 -0500 Subject: [PATCH] adjust logic --- protocol-designer/src/ui/labware/utils.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/protocol-designer/src/ui/labware/utils.ts b/protocol-designer/src/ui/labware/utils.ts index fe55cc5e676..df58031383b 100644 --- a/protocol-designer/src/ui/labware/utils.ts +++ b/protocol-designer/src/ui/labware/utils.ts @@ -51,11 +51,13 @@ export function getLabwareLatestSlotFromCurrentStepIndex( const hasWasteChute = getHasWasteChute(additionalEquipmentOnDeck) // latest moveLabware step related to labwareId at given index - const moveLabwareStepId = filteredSavedStepFormIds.find( - id => - savedStepForms[id].stepType === 'moveLabware' && - savedStepForms[id].labware === labwareId - ) + const moveLabwareStepId = filteredSavedStepFormIds + .filter( + id => + savedStepForms[id].stepType === 'moveLabware' && + savedStepForms[id].labware === labwareId + ) + .pop() const moveLabwareStep = moveLabwareStepId != null ? savedStepForms[moveLabwareStepId] : null