diff --git a/protocol-designer/src/labware-ingred/reducers/index.js b/protocol-designer/src/labware-ingred/reducers/index.js index 0f0fecb941b..28454a4538a 100644 --- a/protocol-designer/src/labware-ingred/reducers/index.js +++ b/protocol-designer/src/labware-ingred/reducers/index.js @@ -9,7 +9,6 @@ import mapValues from 'lodash/mapValues' import max from 'lodash/max' import pickBy from 'lodash/pickBy' import reduce from 'lodash/reduce' -import isEmpty from 'lodash/isEmpty' import {sortedSlotnames, FIXED_TRASH_ID} from '../../constants.js' import {uuid} from '../../utils' @@ -285,6 +284,11 @@ export const ingredLocations = handleActions({ mapValues(labwareContents, well => omit(well, liquidGroupId))) }, + DELETE_CONTAINER: ( + state: LocationsState, + action: ActionType + ): LocationsState => + omit(state, action.payload.containerId), LOAD_FILE: (state: LocationsState, action: LoadFileAction): LocationsState => getPDMetadata(action.payload).ingredLocations, }, {}) @@ -488,8 +492,6 @@ const getLabwareSelectionMode: Selector = createSelector( const getSlotToMoveFrom = (state: BaseState) => rootSelector(state).moveLabwareMode -const getDeckHasLiquid = (state: BaseState) => !isEmpty(getLiquidGroupsById(state)) - const getLiquidGroupsOnDeck: Selector> = createSelector( getLiquidsByLabwareId, (ingredLocationsByLabware) => { @@ -507,6 +509,11 @@ const getLiquidGroupsOnDeck: Selector> = createSelector( } ) +const getDeckHasLiquid: Selector = createSelector( + getLiquidGroupsOnDeck, + (liquidGroups) => liquidGroups.length > 0 +) + // TODO: prune selectors export const selectors = { rootSelector,