Skip to content

Commit

Permalink
fix(app): fall back to stored protocol analysis for pipette data (#16144
Browse files Browse the repository at this point in the history
)

fix RQA-3111
  • Loading branch information
smb2268 authored Aug 27, 2024
1 parent 72c76e5 commit f4d512d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { useInstrumentsQuery } from '@opentrons/react-api-client'
import { TertiaryButton } from '../../../atoms/buttons'
import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis'
import { useStoredProtocolAnalysis } from '../hooks'
import { PipetteWizardFlows } from '../../PipetteWizardFlows'
import { FLOWS } from '../../PipetteWizardFlows/constants'
import { SetupCalibrationItem } from './SetupCalibrationItem'
Expand All @@ -40,11 +41,13 @@ export function SetupFlexPipetteCalibrationItem({
)
const { data: attachedInstruments } = useInstrumentsQuery()
const mostRecentAnalysis = useMostRecentCompletedAnalysis(runId)
const loadPipetteCommand = mostRecentAnalysis?.commands.find(
const storedProtocolAnalysis = useStoredProtocolAnalysis(runId)
const completedAnalysis = mostRecentAnalysis ?? storedProtocolAnalysis
const loadPipetteCommand = completedAnalysis?.commands.find(
(command): command is LoadPipetteRunTimeCommand =>
command.commandType === 'loadPipette' && command.params.mount === mount
)
const requestedPipette = mostRecentAnalysis?.pipettes?.find(
const requestedPipette = completedAnalysis?.pipettes?.find(
pipette => pipette.id === loadPipetteCommand?.result?.pipetteId
)

Expand Down Expand Up @@ -120,7 +123,7 @@ export function SetupFlexPipetteCalibrationItem({
? NINETY_SIX_CHANNEL
: SINGLE_MOUNT_PIPETTES
}
pipetteInfo={mostRecentAnalysis?.pipettes}
pipetteInfo={completedAnalysis?.pipettes}
onComplete={instrumentsRefetch}
/>
)}
Expand Down

0 comments on commit f4d512d

Please sign in to comment.