Skip to content

Commit 2dc62af

Browse files
committed
fix(app): do not gate /runCommandErrors on the run being current
1 parent 9b10793 commit 2dc62af

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

app/src/organisms/Desktop/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderBannerContainer/TerminalRunBannerContainer.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,10 @@ function ProtocolRunErrorBanner({
118118

119119
const { closeCurrentRun } = useCloseCurrentRun()
120120

121-
const { highestPriorityError, commandErrorList } = runErrors
121+
const { highestPriorityError } = runErrors
122122

123123
const handleFailedRunClick = (): void => {
124-
// TODO(jh, 08-15-24): Revisit the control flow here here after
125-
// commandErrorList may be fetched for a non-current run.
126-
if (commandErrorList == null) {
127-
closeCurrentRun()
128-
}
124+
closeCurrentRun()
129125
runHeaderModalContainerUtils.runFailedModalUtils.toggleModal()
130126
}
131127

app/src/organisms/Desktop/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/hooks/useRunHeaderDropTip.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,13 @@ export function useRunHeaderDropTip({
111111
}
112112
}, [runStatus, robotType, isRunCurrent])
113113

114-
// TODO(jh, 08-15-24): The enteredER condition is a hack, because errorCommands are only returned when a run is current.
115-
// Ideally the run should not need to be current to view errorCommands.
116-
117114
// If the run terminates with a "stopped" status, close the run if no tips are attached after running tip check at least once.
118115
// This marks the robot as "not busy" if drop tip CTAs are unnecessary.
119116
useEffect(() => {
120117
if (
121118
runStatus === RUN_STATUS_STOPPED &&
122119
isRunCurrent &&
123-
(initialPipettesWithTipsCount === 0 || robotType === OT2_ROBOT_TYPE) &&
124-
!enteredER
120+
(initialPipettesWithTipsCount === 0 || robotType === OT2_ROBOT_TYPE)
125121
) {
126122
closeCurrentRun()
127123
}

app/src/organisms/Desktop/Devices/ProtocolRun/ProtocolRunHeader/hooks/useRunErrors.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useRunCommandErrors } from '@opentrons/react-api-client'
22

33
import { isTerminalRunStatus } from '../utils'
4-
import { useMostRecentRunId } from '/app/resources/runs'
54
import { getHighestPriorityError } from '/app/transformations/runs'
65

76
import type { RunStatus, Run } from '@opentrons/api-client'
@@ -27,14 +26,11 @@ export function useRunErrors({
2726
runRecord,
2827
runStatus,
2928
}: UseRunErrorsProps): UseRunErrorsResult {
30-
const mostRecentRunId = useMostRecentRunId()
31-
const isMostRecentRun = mostRecentRunId === runId
32-
3329
const { data: commandErrorList } = useRunCommandErrors(
3430
runId,
3531
{ cursor: 0, pageLength: ALL_COMMANDS_PAGE_LENGTH },
3632
{
37-
enabled: isTerminalRunStatus(runStatus) && isMostRecentRun,
33+
enabled: isTerminalRunStatus(runStatus),
3834
}
3935
)
4036

0 commit comments

Comments
 (0)