@@ -5,15 +5,14 @@ import {
5
5
useCreateMaintenanceRunLabwareDefinitionMutation ,
6
6
useDeleteMaintenanceRunMutation ,
7
7
} from '@opentrons/react-api-client'
8
- import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
8
+ import { FLEX_ROBOT_TYPE , OT2_ROBOT_TYPE } from '@opentrons/shared-data'
9
9
10
10
import {
11
11
useCreateTargetedMaintenanceRunMutation ,
12
12
useMostRecentCompletedAnalysis ,
13
13
useNotifyRunQuery ,
14
14
} from '/app/resources/runs'
15
15
import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration'
16
- import { getRelevantOffsets } from '/app/organisms/LabwarePositionCheck/LPCFlows/utils'
17
16
import {
18
17
useLPCLabwareInfo ,
19
18
useCompatibleAnalysis ,
@@ -150,14 +149,12 @@ export function useLPCFlows({
150
149
// Avoid accidentally creating several maintenance runs if a request is ongoing.
151
150
if ( ! isLaunching ) {
152
151
setIsLaunching ( true )
153
- const labwareOffsets = getRelevantOffsets (
154
- robotType ,
155
- ot2Offsets ,
156
- flexOffsets ?? [ ]
157
- )
158
- const createRunData = labwareOffsets != null ? { labwareOffsets } : { }
152
+ // Inject OT-2 offsets into the maintenance run upon creation.
153
+ // The Flex injects offsets directly in LPC commands and therefore should not load them into the maintenance run.
154
+ const injectedOffsets =
155
+ robotType === OT2_ROBOT_TYPE ? { labwareOffsets : ot2Offsets } : { }
159
156
160
- return createTargetedMaintenanceRun ( createRunData ) . then (
157
+ return createTargetedMaintenanceRun ( injectedOffsets ) . then (
161
158
maintenanceRun => {
162
159
setMaintenanceRunId ( maintenanceRun . data . id )
163
160
}
0 commit comments