diff --git a/app/src/organisms/RunProgressMeter/index.tsx b/app/src/organisms/RunProgressMeter/index.tsx index 4c7c92f5bd8..47838a0bb47 100644 --- a/app/src/organisms/RunProgressMeter/index.tsx +++ b/app/src/organisms/RunProgressMeter/index.tsx @@ -42,7 +42,10 @@ import { ProgressBar } from '../../atoms/ProgressBar' import { useDownloadRunLog, useRobotType } from '../Devices/hooks' import { InterventionTicks } from './InterventionTicks' import { isInterventionCommand } from '../InterventionModal/utils' -import { useNotifyRunQuery } from '../../resources/runs' +import { + useNotifyLastRunCommand, + useNotifyRunQuery, +} from '../../resources/runs' import type { RunStatus } from '@opentrons/api-client' @@ -79,7 +82,7 @@ export function RunProgressMeter(props: RunProgressMeterProps): JSX.Element { pageLength: 1, }) const analysisCommands = analysis?.commands ?? [] - const lastRunCommand = allCommandsQueryData?.data[0] ?? null + const lastRunCommand = useNotifyLastRunCommand(runId) const runCommandsLength = allCommandsQueryData?.meta.totalLength const downloadIsDisabled = diff --git a/app/src/pages/RunningProtocol/index.tsx b/app/src/pages/RunningProtocol/index.tsx index dcacf61ab34..306470ea770 100644 --- a/app/src/pages/RunningProtocol/index.tsx +++ b/app/src/pages/RunningProtocol/index.tsx @@ -25,6 +25,7 @@ import { RUN_STATUS_STOP_REQUESTED, RUN_STATUS_BLOCKED_BY_OPEN_DOOR, RUN_STATUS_AWAITING_RECOVERY, + RUN_STATUS_FINISHING, } from '@opentrons/api-client' import { useFeatureFlag } from '../../redux/config' @@ -203,7 +204,8 @@ export function RunningProtocol(): JSX.Element { {interventionModalCommandKey != null && runRecord?.data != null && lastRunCommand != null && - isInterventionCommand(lastRunCommand) ? ( + isInterventionCommand(lastRunCommand) && + runStatus !== RUN_STATUS_FINISHING ? (