Skip to content

Commit

Permalink
always home both axis
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Oct 23, 2024
1 parent c9a57ad commit fb6e5b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/src/organisms/ErrorRecoveryFlows/ErrorRecoveryWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { RecoveryInProgress } from './RecoveryInProgress'
import { getErrorKind } from './utils'
import { RECOVERY_MAP } from './constants'
import { useHomeGripperZAxis } from './hooks'
import { useHomeGripper } from './hooks'

import type { LabwareDefinition2, RobotType } from '@opentrons/shared-data'
import type { RecoveryRoute, RouteStep, RecoveryContentProps } from './types'
Expand Down Expand Up @@ -90,7 +90,7 @@ export function ErrorRecoveryWizard(
routeUpdateActions,
})

useHomeGripperZAxis(props)
useHomeGripper(props)

return <ErrorRecoveryComponent errorKind={errorKind} {...props} />
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
RELEASE_GRIPPER_JAW,
buildPickUpTips,
buildIgnorePolicyRules,
HOME_GRIPPER_Z_AXIS,
HOME_GRIPPER,
} from '../useRecoveryCommands'
import { RECOVERY_MAP } from '../../constants'

Expand Down Expand Up @@ -271,10 +271,7 @@ describe('useRecoveryCommands', () => {
await result.current.homeGripper()
})

expect(mockChainRunCommands).toHaveBeenCalledWith(
[HOME_GRIPPER_Z_AXIS],
false
)
expect(mockChainRunCommands).toHaveBeenCalledWith([HOME_GRIPPER], false)
})

it('should call skipFailedCommand and show success toast on success', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,7 @@ export function useRecoveryCommands({
}, [chainRunRecoveryCommands])

const homeGripper = useCallback((): Promise<CommandData[]> => {
const gripperAxis =
failedCommandByRunRecord?.error?.errorCode === '2003'
? HOME_GRIPPER
: HOME_GRIPPER_Z_AXIS
return chainRunRecoveryCommands([gripperAxis])
return chainRunRecoveryCommands([HOME_GRIPPER])
}, [chainRunRecoveryCommands])

const moveLabwareWithoutPause = useCallback((): Promise<CommandData[]> => {
Expand Down Expand Up @@ -314,12 +310,6 @@ export const RELEASE_GRIPPER_JAW: CreateCommand = {
intent: 'fixit',
}

export const HOME_GRIPPER_Z_AXIS: CreateCommand = {
commandType: 'home',
params: { axes: ['extensionZ'] },
intent: 'fixit',
}

export const HOME_GRIPPER: CreateCommand = {
commandType: 'home',
params: { axes: ['extensionZ', 'extensionJaw'] },
Expand Down

0 comments on commit fb6e5b1

Please sign in to comment.