diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx index 604bd253cd0..454a470a700 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx @@ -18,7 +18,6 @@ import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE, parseAllRequiredModuleModels, - parseLiquidsInLoadOrder, } from '@opentrons/shared-data' import { Line } from '../../../atoms/structure' @@ -165,11 +164,7 @@ export function ProtocolRunSetup({ }) const liquids = protocolAnalysis?.liquids ?? [] - const liquidsInLoadOrder = - protocolAnalysis != null - ? parseLiquidsInLoadOrder(liquids, protocolAnalysis.commands) - : [] - const hasLiquids = liquidsInLoadOrder.length > 0 + const hasLiquids = liquids.length > 0 const hasModules = protocolAnalysis != null && modules.length > 0 // need config compatibility (including check for single slot conflicts) const requiredDeckConfigCompatibility = getRequiredDeckConfig( @@ -191,7 +186,11 @@ export function ProtocolRunSetup({ const [liquidSetupComplete, setLiquidSetupComplete] = React.useState( !hasLiquids ) - if (!hasLiquids && missingSteps.includes('liquids')) { + if ( + !hasLiquids && + protocolAnalysis != null && + missingSteps.includes('liquids') + ) { setMissingSteps(missingSteps.filter(step => step !== 'liquids')) } const [lpcComplete, setLpcComplete] = React.useState(false) diff --git a/app/src/pages/ProtocolSetup/index.tsx b/app/src/pages/ProtocolSetup/index.tsx index 27de7b8f62a..17c081150ce 100644 --- a/app/src/pages/ProtocolSetup/index.tsx +++ b/app/src/pages/ProtocolSetup/index.tsx @@ -515,6 +515,7 @@ function PrepareToRun({ : 'not ready' // Liquids information const liquidsInProtocol = mostRecentAnalysis?.liquids ?? [] + const areLiquidsInProtocol = liquidsInProtocol.length > 0 const isReadyToRun = incompleteInstrumentCount === 0 && areModulesReady && areFixturesReady @@ -528,7 +529,7 @@ function PrepareToRun({ !( labwareConfirmed && offsetsConfirmed && - (liquidsConfirmed || liquidsInProtocol.length === 0) + (liquidsConfirmed || !areLiquidsInProtocol) ) ) { confirmStepsComplete() @@ -803,18 +804,16 @@ function PrepareToRun({ }} title={i18n.format(t('liquids'), 'capitalize')} status={ - liquidsConfirmed || liquidsInProtocol.length === 0 - ? 'ready' - : 'general' + liquidsConfirmed || !areLiquidsInProtocol ? 'ready' : 'general' } detail={ - liquidsInProtocol.length > 0 + areLiquidsInProtocol ? t('initial_liquids_num', { count: liquidsInProtocol.length, }) : t('liquids_not_in_setup') } - interactionDisabled={liquidsInProtocol.length === 0} + interactionDisabled={!areLiquidsInProtocol} /> ) : ( @@ -889,6 +888,8 @@ export function ProtocolSetup(): JSX.Element { } ) + const areLiquidsInProtocol = (mostRecentAnalysis?.liquids?.length ?? 0) > 0 + React.useEffect(() => { if (mostRecentAnalysis?.status === 'completed') { setIsPollingForCompletedAnalysis(false) @@ -954,7 +955,7 @@ export function ProtocolSetup(): JSX.Element { const missingSteps = [ !offsetsConfirmed ? t('applied_labware_offsets') : null, !labwareConfirmed ? t('labware_placement') : null, - !liquidsConfirmed ? t('liquids') : null, + !liquidsConfirmed && areLiquidsInProtocol ? t('liquids') : null, ].filter(s => s != null) const { confirm: confirmMissingSteps,