Skip to content

Commit

Permalink
refactor: adjust id and don't error when image is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
fbelginetw committed Nov 7, 2024
1 parent fc5f244 commit 0f55cd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function ControlledLabwareListItems(): JSX.Element | null {
render={({ field }) => {
return (
<>
{labwares.map(labware => {
{labwares.map((labware, index) => {
const labwareDef = defs[labware.labwareURI]
const dropdownProps = {
currentOption: {
Expand All @@ -63,7 +63,7 @@ export function ControlledLabwareListItems(): JSX.Element | null {
return (
<ListItem
type="noActive"
key={`${labwareDef.parameters.loadName}`}
key={`${index}_${labwareDef.parameters.loadName}`}
>
<ListItemCustomize
dropdown={dropdownProps}
Expand Down
2 changes: 1 addition & 1 deletion opentrons-ai-client/src/molecules/LabwareDiagram/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function LabwareDiagram({
}: {
def: LabwareDefinition2
}): JSX.Element | undefined {
const labwareSrc: string = labwareImages[def.parameters.loadName][0] ?? ''
const labwareSrc: string = labwareImages[def.parameters.loadName]?.[0] ?? ''

if (labwareSrc === '') {
return
Expand Down

0 comments on commit 0f55cd7

Please sign in to comment.