@@ -30,6 +30,7 @@ import {
30
30
import { OddModal } from '/app/molecules/OddModal'
31
31
import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration/'
32
32
33
+ import { useSendIdentifyStacker } from '../ModuleWizardFlows/hooks'
33
34
import { getOptions } from './utils'
34
35
35
36
import type { ModalProps } from '@opentrons/components'
@@ -41,7 +42,6 @@ import type {
41
42
CutoutId ,
42
43
} from '@opentrons/shared-data'
43
44
import type { OddModalHeaderBaseProps } from '/app/molecules/OddModal/types'
44
- import { useSendIdentifyStacker } from '../ModuleWizardFlows/hooks'
45
45
46
46
const FLEX_STACKER_FIXTURE = 'flexStackerModuleV1'
47
47
const MODULE_IDENTIFY_TIME_MS = 10000
@@ -168,7 +168,10 @@ export function AddFixtureModal({
168
168
const sendIdentifyStacker = useSendIdentifyStacker ( )
169
169
const attachedModules = useModulesQuery ( ) . data ?. data
170
170
171
- const handleAddFixture = ( addedCutoutConfigs : CutoutConfigMap [ ] , fixtureSerialNumber ?: string ) : void => {
171
+ const handleAddFixture = (
172
+ addedCutoutConfigs : CutoutConfigMap [ ] ,
173
+ fixtureSerialNumber ?: string
174
+ ) : void => {
172
175
const addedCutoutConfigsWithCombo = replaceCutoutFixtureWithComboFixture (
173
176
addedCutoutConfigs ,
174
177
deckConfigWithAA ,
@@ -182,11 +185,11 @@ export function AddFixtureModal({
182
185
)
183
186
} ) as CutoutConfig [ ] // we can do this bc we are mapping each aa to the proper fixture
184
187
185
- if ( fixtureSerialNumber ) {
186
- const module = attachedModules ?. find (
187
- m => m . serialNumber === fixtureSerialNumber
188
- ) ?? null
189
- if ( module !== null ) {
188
+ if ( fixtureSerialNumber ) {
189
+ const module =
190
+ attachedModules ?. find ( m => m . serialNumber === fixtureSerialNumber ) ??
191
+ null
192
+ if ( module !== null ) {
190
193
sendIdentifyStacker ( module , false )
191
194
}
192
195
}
@@ -196,16 +199,16 @@ export function AddFixtureModal({
196
199
}
197
200
198
201
const handleIdentifyFixture = ( fixtureSerialNumber : string ) : void => {
199
- const module = attachedModules ?. find (
200
- m => m . serialNumber === fixtureSerialNumber
201
- ) ?? null
202
- if ( module !== null ) {
202
+ const module =
203
+ attachedModules ?. find ( m => m . serialNumber === fixtureSerialNumber ) ?? null
204
+ if ( module !== null ) {
203
205
// Identify the stacker module
204
206
sendIdentifyStacker ( module , true , 'blue' )
205
- //Ensure that the module reverts after a set time
206
- setTimeout ( ( ) => { sendIdentifyStacker ( module , false ) } , MODULE_IDENTIFY_TIME_MS )
207
+ // Ensure that the module reverts after a set time
208
+ setTimeout ( ( ) => {
209
+ sendIdentifyStacker ( module , false )
210
+ } , MODULE_IDENTIFY_TIME_MS )
207
211
}
208
-
209
212
}
210
213
211
214
const fixtureOptions = availableOptions . map ( cutoutConfigs => {
@@ -216,9 +219,12 @@ export function AddFixtureModal({
216
219
usbPort ?. hubPort != null
217
220
? `${ usbPort . port } .${ usbPort . hubPort } `
218
221
: usbPort ?. port
219
-
222
+
220
223
const fixtureSerialNumber = cutoutConfigs [ 0 ] . opentronsModuleSerialNumber
221
- if ( fixtureSerialNumber !== undefined && cutoutConfigs [ 0 ] . cutoutFixtureId . includes ( FLEX_STACKER_FIXTURE ) ) {
224
+ if (
225
+ fixtureSerialNumber !== undefined &&
226
+ cutoutConfigs [ 0 ] . cutoutFixtureId . includes ( FLEX_STACKER_FIXTURE )
227
+ ) {
222
228
return (
223
229
< FixtureOption
224
230
key = { cutoutConfigs [ 0 ] . cutoutFixtureId }
@@ -232,13 +238,12 @@ export function AddFixtureModal({
232
238
} }
233
239
secondaryButtonText = { t ( 'identify' ) }
234
240
secondaryOnClickHandler = { ( ) => {
235
- handleIdentifyFixture ( fixtureSerialNumber ) }
236
- }
241
+ handleIdentifyFixture ( fixtureSerialNumber )
242
+ } }
237
243
isOnDevice = { isOnDevice }
238
244
/>
239
245
)
240
- }
241
- else {
246
+ } else {
242
247
return (
243
248
< FixtureOption
244
249
key = { cutoutConfigs [ 0 ] . cutoutFixtureId }
@@ -278,7 +283,7 @@ export function AddFixtureModal({
278
283
) : (
279
284
// This is the modal with the module fixtures
280
285
// Something that checks if this is a stacker module with a TODO to remove/update if other identifiable modules are added
281
- // Call to the use identify thing that transitions back to regular after a second?
286
+ // Call to the use identify thing that transitions back to regular after a second?
282
287
< Modal { ...modalProps } >
283
288
< Flex flexDirection = { DIRECTION_COLUMN } gridGap = { SPACING . spacing16 } >
284
289
< StyledText desktopStyle = "bodyDefaultRegular" >
0 commit comments