diff --git a/protocol-designer/src/labware-ingred/actions/thunks.ts b/protocol-designer/src/labware-ingred/actions/thunks.ts index dbda17a9974..33d054f930e 100644 --- a/protocol-designer/src/labware-ingred/actions/thunks.ts +++ b/protocol-designer/src/labware-ingred/actions/thunks.ts @@ -131,7 +131,7 @@ export const duplicateLabware: ( robotType, labwareDef ) - if (duplicateSlot == null) { + if (duplicateSlot == null && !templateLabwareIdIsOffDeck) { console.error('no slots available, cannot duplicate labware') } const allNicknamesById = uiLabwareSelectors.getLabwareNicknamesById(state) @@ -140,15 +140,29 @@ export const duplicateLabware: ( Object.keys(allNicknamesById).map((id: string) => allNicknamesById[id]), // NOTE: flow won't do Object.values here >:( templateNickname ) + const duplicateLabwareId = uuid() + ':' + templateLabwareDefURI - if (templateLabwareDefURI && duplicateSlot != null) { + if (templateLabwareDefURI) { + if (templateLabwareIdIsOffDeck) { + dispatch({ + type: 'DUPLICATE_LABWARE', + payload: { + duplicateLabwareNickname, + templateLabwareId, + duplicateLabwareId, + slot: 'offDeck', + }, + }) + } + } + if (duplicateSlot != null && !templateLabwareIdIsOffDeck) { dispatch({ type: 'DUPLICATE_LABWARE', payload: { duplicateLabwareNickname, templateLabwareId, - duplicateLabwareId: uuid() + ':' + templateLabwareDefURI, - slot: templateLabwareIdIsOffDeck ? 'offDeck' : duplicateSlot, + duplicateLabwareId, + slot: duplicateSlot, }, }) }