Skip to content

Commit

Permalink
Fix logic to delete run if cancelled in the middle of the run
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Jul 31, 2024
1 parent d8148f7 commit 6e410b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function ConfirmCancelRunModal({
isLoading: isDismissing,
} = useDismissCurrentRunMutation({
onSuccess: () => {
if (isQuickTransfer) {
if (isQuickTransfer && !isActiveRun) {
deleteRun(runId)
}
},
Expand Down
10 changes: 9 additions & 1 deletion app/src/pages/RunSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ export function RunSummary(): JSX.Element {
// TODO(jh, 07-24-24): After EXEC-504, add reportRecoveredRunResult here.

const returnToQuickTransfer = (): void => {
deleteRun(runId)
if (!isRunCurrent) {
deleteRun(runId)
} else {
closeCurrentRun({
onSuccess: () => {
deleteRun(runId)
},
})
}
navigate('/quick-transfer')
}

Expand Down

0 comments on commit 6e410b8

Please sign in to comment.