Skip to content

Commit

Permalink
fix(protocol-designer): lazy load air gap/delay FF from local storage (
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin authored Aug 3, 2020
1 parent 2c24069 commit 414dc0b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ describe('createPresavedStepForm', () => {
pipette: 'leftPipetteId',
stepType: 'moveLiquid',
// default fields
...(airGapEnabled ? { aspirate_airGap_volume: '1' } : {}),
...(airGapEnabled
? {
aspirate_airGap_volume: '1',
aspirate_delay_seconds: '1',
dispense_delay_seconds: '1',
}
: {}),
aspirate_flowRate: null,
aspirate_labware: null,
aspirate_mix_checkbox: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import {
} from '../../constants'
import type { StepType, StepFieldName } from '../../form-types'

const isAirGapDelayEnabled = getPrereleaseFeatureFlag(
'OT_PD_ENABLE_AIR_GAP_AND_DELAY'
)
const isAirGapDelayEnabled = () =>
getPrereleaseFeatureFlag('OT_PD_ENABLE_AIR_GAP_AND_DELAY')
// TODO: Ian 2019-01-17 move this somewhere more central - see #2926

export function getDefaultsForStepType(
Expand Down Expand Up @@ -69,7 +68,7 @@ export function getDefaultsForStepType(
blowout_location: FIXED_TRASH_ID,
preWetTip: false,

...(isAirGapDelayEnabled
...(isAirGapDelayEnabled()
? { aspirate_delay_seconds: '1', dispense_delay_seconds: '1' }
: {}),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ const updatePatchOnPipetteChange = (
return patch
}

const clearedDisposalVolumeFields = getDefaultFields(
'disposalVolume_volume',
'disposalVolume_checkbox'
)
const getClearedDisposalVolumeFields = () =>
getDefaultFields('disposalVolume_volume', 'disposalVolume_checkbox')

const updatePatchDisposalVolumeFields = (
patch: FormPatch,
Expand All @@ -241,7 +239,7 @@ const updatePatchDisposalVolumeFields = (
// or whenever disposalVolume_checkbox is cleared
return {
...patch,
...clearedDisposalVolumeFields,
...getClearedDisposalVolumeFields(),
}
}

Expand Down Expand Up @@ -321,7 +319,7 @@ const clampDisposalVolume = (
}
: {
...patch,
...clearedDisposalVolumeFields,
...getClearedDisposalVolumeFields(),
}
}

Expand Down

0 comments on commit 414dc0b

Please sign in to comment.