Skip to content

Commit

Permalink
address some more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Mar 20, 2024
1 parent f15f710 commit 8a3bf8d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions protocol-designer/src/ui/labware/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getLabwareOffDeck, getLabwareInColumn4 } from './utils'
import type { LabwareEntity } from '@opentrons/step-generation'
import type { DropdownOption, Options } from '@opentrons/components'
import type { Selector } from '../../types'
import {
import type {
AllTemporalPropertiesForTimelineFrame,
SavedStepFormState,
} from '../../step-forms'
Expand Down Expand Up @@ -39,7 +39,7 @@ export const _sortLabwareDropdownOptions = (options: Options): Options =>
return a.name.localeCompare(b.name)
})

const getNickNames = (
const getNickname = (
nicknamesById: Record<string, string>,
initialDeckSetup: AllTemporalPropertiesForTimelineFrame,
labwareId: string,
Expand All @@ -65,7 +65,7 @@ const getNickNames = (
labwareId
)

let nickName = nicknamesById[labwareId]
let nickName: string = nicknamesById[labwareId]
if (module != null) {
nickName = `${nicknamesById[labwareId]} in ${module}`
} else if (isOffDeck) {
Expand Down Expand Up @@ -109,8 +109,9 @@ export const getMoveLabwareOptions: Selector<Options> = createSelector(
form.newLocation === wasteChuteLocation
)

const isAdapter = labwareEntity.def.allowedRoles?.includes('adapter')
const nickName = getNickNames(
const isAdapter =
labwareEntity.def.allowedRoles?.includes('adapter') ?? false
const nickName = getNickname(
nicknamesById,
initialDeckSetup,
labwareId,
Expand Down Expand Up @@ -168,8 +169,9 @@ export const getLabwareOptions: Selector<Options> = createSelector(
form.newLocation === wasteChuteLocation
)

const isAdapter = labwareEntity.def.allowedRoles?.includes('adapter')
const nickName = getNickNames(
const isAdapter =
labwareEntity.def.allowedRoles?.includes('adapter') ?? false
const nickName = getNickname(
nicknamesById,
initialDeckSetup,
labwareId,
Expand Down

0 comments on commit 8a3bf8d

Please sign in to comment.