Skip to content

Commit

Permalink
cleanup and pass labware def to getNextAvailableDeckSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed Dec 11, 2024
1 parent f0e1202 commit 62c507e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ export function SlotOverflowMenu(

const { makeSnackbar } = useKitchen()

const isSpace = getNextAvailableDeckSlot(deckSetup, robotType) != null

const {
labware: deckSetupLabware,
modules: deckSetupModules,
Expand All @@ -133,6 +131,9 @@ export function SlotOverflowMenu(
? lw.id === location
: lw.slot === location || lw.slot === moduleOnSlot?.id
)
const isSpace =
getNextAvailableDeckSlot(deckSetup, robotType, labwareOnSlot?.def) != null

const isLabwareTiprack = labwareOnSlot?.def.parameters.isTiprack ?? false
const isLabwareAnAdapter =
labwareOnSlot?.def.allowedRoles?.includes('adapter') ?? false
Expand Down Expand Up @@ -171,10 +172,8 @@ export function SlotOverflowMenu(
location as AddressableAreaName
)

function handleDuplicate(): void {
console.log('test')
const handleDuplicate = (): void => {
if (!isSpace) {
console.log('test')
makeSnackbar(t('deck_slots_full') as string)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
openIngredientSelector,
} from '../../../../labware-ingred/actions'
import { EditNickNameModal } from '../../../../organisms'
import { useKitchen } from '../../../../organisms/Kitchen/hooks'
import { deleteModule } from '../../../../step-forms/actions'
import { deleteDeckFixture } from '../../../../step-forms/actions/additionalItems'
import { getDeckSetupForActiveItem } from '../../../../top-selectors/labware-locations'
Expand All @@ -20,7 +21,6 @@ import { SlotOverflowMenu } from '../SlotOverflowMenu'

import type { NavigateFunction } from 'react-router-dom'
import type { LabwareDefinition2 } from '@opentrons/shared-data'
import { useKitchen } from '../../../../organisms/Kitchen/hooks'

const mockNavigate = vi.fn()

Expand Down

0 comments on commit 62c507e

Please sign in to comment.