Skip to content

Commit

Permalink
fix(protocol-designer): fix bug where new protocol w 1 pipette delete…
Browse files Browse the repository at this point in the history
…d fixedTrash (#2797)
  • Loading branch information
IanLondon authored Dec 10, 2018
1 parent c9a4e3f commit 2052f49
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions protocol-designer/src/labware-ingred/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2052f49

Please sign in to comment.