Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(app): Use currentState for tip detection #16904

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { useEffect } from 'react'

import { useHost } from '@opentrons/react-api-client'
import { RUN_STATUS_IDLE, RUN_STATUS_STOPPED } from '@opentrons/api-client'
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data'

import {
useDropTipWizardFlows,
useTipAttachmentStatus,
} from '/app/organisms/DropTipWizardFlows'
import { useDropTipWizardFlows } from '/app/organisms/DropTipWizardFlows'
import { useProtocolDropTipModal } from '../modals'
import {
useCloseCurrentRun,
Expand All @@ -16,13 +12,12 @@ import {
} from '/app/resources/runs'
import { isTerminalRunStatus } from '../../utils'
import { lastRunCommandPromptedErrorRecovery } from '/app/local-resources/commands'
import { useTipAttachmentStatus } from '/app/resources/instruments'

import type { RobotType } from '@opentrons/shared-data'
import type { Run, RunStatus } from '@opentrons/api-client'
import type {
DropTipWizardFlowsProps,
PipetteWithTip,
} from '/app/organisms/DropTipWizardFlows'
import type { PipetteWithTip } from '/app/resources/instruments'
import type { DropTipWizardFlowsProps } from '/app/organisms/DropTipWizardFlows'
import type { UseProtocolDropTipModalResult } from '../modals'
import type { PipetteDetails } from '/app/resources/maintenance_runs'

Expand All @@ -49,7 +44,6 @@ export function useRunHeaderDropTip({
robotType,
runStatus,
}: UseRunHeaderDropTipParams): UseRunHeaderDropTipResult {
const host = useHost()
const isRunCurrent = useIsRunCurrent(runId)
const enteredER = runRecord?.data.hasEverEnteredErrorRecovery ?? false

Expand All @@ -66,7 +60,6 @@ export function useRunHeaderDropTip({
} = useTipAttachmentStatus({
runId,
runRecord: runRecord ?? null,
host,
})

const dropTipModalUtils = useProtocolDropTipModal({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useHomePipettes } from '/app/local-resources/instruments'
import type { PipetteData } from '@opentrons/api-client'
import type { IconProps } from '@opentrons/components'
import type { UseHomePipettesProps } from '/app/local-resources/instruments'
import type { TipAttachmentStatusResult } from '/app/organisms/DropTipWizardFlows'
import type { TipAttachmentStatusResult } from '/app/resources/instruments'

type UseProtocolDropTipModalProps = Pick<
UseHomePipettesProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { useHomePipettes } from '/app/local-resources/instruments'
import type { HostConfig } from '@opentrons/api-client'
import type { OddModalHeaderBaseProps } from '/app/molecules/OddModal/types'
import type { UseHomePipettesProps } from '/app/local-resources/instruments'
import type { PipetteWithTip } from './hooks'
import type { PipetteDetails } from '/app/resources/maintenance_runs'
import type { PipetteWithTip } from '/app/resources/instruments'

type TipsAttachedModalProps = Pick<UseHomePipettesProps, 'onSettled'> & {
aPipetteWithTip: PipetteWithTip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useDropTipWizardFlows } from '..'
import type { Mock } from 'vitest'
import type { PipetteModelSpecs } from '@opentrons/shared-data'
import type { HostConfig } from '@opentrons/api-client'
import type { PipetteWithTip } from '../hooks'
import type { PipetteWithTip } from '/app/resources/instruments'

vi.mock('/app/resources/runs/useCloseCurrentRun')
vi.mock('..')
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion app/src/organisms/DropTipWizardFlows/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './errors'
export * from './useDropTipWithType'
export * from './useTipAttachmentStatus'
export * from './useDropTipLocations'
export { useDropTipRouting } from './useDropTipRouting'
export { useDropTipWithType } from './useDropTipWithType'
Expand Down
Loading
Loading