Skip to content

Commit

Permalink
Delete run record, add redirect on ODD
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Aug 15, 2024
1 parent 9715946 commit 03f5843
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import {
useModulesQuery,
useDoorQuery,
useDeleteRunMutation,
useHost,
useRunCommandErrors,
} from '@opentrons/react-api-client'
Expand Down Expand Up @@ -165,6 +166,7 @@ export function ProtocolRunHeader({
const robotAnalyticsData = useRobotAnalyticsData(robotName)
const isRobotViewable = useIsRobotViewable(robotName)
const runStatus = useRunStatus(runId)
const { deleteRun } = useDeleteRunMutation()
const { analysisErrors } = useProtocolAnalysisErrors(runId)
const isRunCurrent = Boolean(
useNotifyRunQuery(runId, { refetchInterval: CURRENT_RUN_POLL_MS })?.data
Expand Down Expand Up @@ -291,6 +293,7 @@ export function ProtocolRunHeader({
closeCurrentRun({
onSuccess: () => {
if (isQuickTransfer) {
deleteRun(runId)
navigate(`/devices/${robotName}`)
}
},
Expand Down Expand Up @@ -345,6 +348,7 @@ export function ProtocolRunHeader({
closeCurrentRun({
onSuccess: () => {
if (isQuickTransfer) {
deleteRun(runId)
navigate(`/devices/${robotName}`)
}
},
Expand Down Expand Up @@ -457,6 +461,7 @@ export function ProtocolRunHeader({
closeCurrentRun({
onSuccess: () => {
if (isQuickTransfer) {
deleteRun(runId)
navigate(`/devices/${robotName}`)
}
},
Expand Down
5 changes: 5 additions & 0 deletions app/src/pages/RunSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ export function RunSummary(): JSX.Element {
reportRecoveredRunResult(runStatus, enteredER)
}
}, [isRunCurrent, enteredER])
React.useEffect(() => {
if (runRecord == null) {
navigate('/')
}
})

const { reset, isResetRunLoading } = useRunControls(runId, onCloneRunSuccess)
const trackEvent = useTrackEvent()
Expand Down

0 comments on commit 03f5843

Please sign in to comment.