From fcb6d9573019bf6a478807c4d0b9abdd5fd35c87 Mon Sep 17 00:00:00 2001 From: IanLondon Date: Mon, 10 Dec 2018 09:49:54 -0500 Subject: [PATCH] fix(protocol-designer): fix bug where new protocol w 1 pipette deleted fixedTrash without fixedTrash, any step that drops a tip or otherwise interacts with fixedTrash will cause PD to whitescreen --- .../src/labware-ingred/reducers/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/protocol-designer/src/labware-ingred/reducers/index.js b/protocol-designer/src/labware-ingred/reducers/index.js index 28454a4538a..78ab546ce4b 100644 --- a/protocol-designer/src/labware-ingred/reducers/index.js +++ b/protocol-designer/src/labware-ingred/reducers/index.js @@ -198,22 +198,23 @@ export const containers = handleActions({ state: ContainersState, action: {payload: NewProtocolFields} ): ContainersState => { - const initialTipracks = [action.payload.left, action.payload.right].reduce((acc, mount) => { + const nextState = [action.payload.left, action.payload.right].reduce((acc: ContainersState, mount): ContainersState => { if (mount.tiprackModel) { const id = `${uuid()}:${String(mount.tiprackModel)}` return { ...acc, [id]: { - slot: nextEmptySlot(_loadedContainersBySlot(acc || {})), + slot: nextEmptySlot(_loadedContainersBySlot(acc)), type: mount.tiprackModel, - disambiguationNumber: getNextDisambiguationNumber(acc || {}, String(mount.tiprackModel)), + disambiguationNumber: getNextDisambiguationNumber(acc, String(mount.tiprackModel)), id, - name: null, // create with null name, so we force explicit naming. + name: null, }, } } + return acc }, state) - return initialTipracks || {} + return nextState }, }, initialLabwareState)