Skip to content

Commit 6e410b8

Browse files
committed
Fix logic to delete run if cancelled in the middle of the run
1 parent d8148f7 commit 6e410b8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function ConfirmCancelRunModal({
5656
isLoading: isDismissing,
5757
} = useDismissCurrentRunMutation({
5858
onSuccess: () => {
59-
if (isQuickTransfer) {
59+
if (isQuickTransfer && !isActiveRun) {
6060
deleteRun(runId)
6161
}
6262
},

app/src/pages/RunSummary/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,15 @@ export function RunSummary(): JSX.Element {
162162
// TODO(jh, 07-24-24): After EXEC-504, add reportRecoveredRunResult here.
163163

164164
const returnToQuickTransfer = (): void => {
165-
deleteRun(runId)
165+
if (!isRunCurrent) {
166+
deleteRun(runId)
167+
} else {
168+
closeCurrentRun({
169+
onSuccess: () => {
170+
deleteRun(runId)
171+
},
172+
})
173+
}
166174
navigate('/quick-transfer')
167175
}
168176

0 commit comments

Comments
 (0)