Skip to content

Commit

Permalink
fix(protocol-designer): fix when add liquid hint is shown (#2787)
Browse files Browse the repository at this point in the history
Closes #2777
  • Loading branch information
IanLondon authored Dec 6, 2018
1 parent fda0920 commit eb59fec
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions protocol-designer/src/labware-ingred/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -285,6 +284,11 @@ export const ingredLocations = handleActions({
mapValues(labwareContents, well =>
omit(well, liquidGroupId)))
},
DELETE_CONTAINER: (
state: LocationsState,
action: ActionType<typeof actions.deleteContainer>
): LocationsState =>
omit(state, action.payload.containerId),
LOAD_FILE: (state: LocationsState, action: LoadFileAction): LocationsState =>
getPDMetadata(action.payload).ingredLocations,
}, {})
Expand Down Expand Up @@ -488,8 +492,6 @@ const getLabwareSelectionMode: Selector<boolean> = createSelector(

const getSlotToMoveFrom = (state: BaseState) => rootSelector(state).moveLabwareMode

const getDeckHasLiquid = (state: BaseState) => !isEmpty(getLiquidGroupsById(state))

const getLiquidGroupsOnDeck: Selector<Array<string>> = createSelector(
getLiquidsByLabwareId,
(ingredLocationsByLabware) => {
Expand All @@ -507,6 +509,11 @@ const getLiquidGroupsOnDeck: Selector<Array<string>> = createSelector(
}
)

const getDeckHasLiquid: Selector<boolean> = createSelector(
getLiquidGroupsOnDeck,
(liquidGroups) => liquidGroups.length > 0
)

// TODO: prune selectors
export const selectors = {
rootSelector,
Expand Down

0 comments on commit eb59fec

Please sign in to comment.