Skip to content

Commit

Permalink
fix(app): fix ODD "run again" routing (#14694)
Browse files Browse the repository at this point in the history
Closes RABR-179

Clicking "run again" repeatedly causes multiple cloneRun hooks to fire, resulting in sometimes bizarre routing scenarios. If a cloneRun is in progress, do not let another cloneRun occur.
  • Loading branch information
mjhuff authored Mar 19, 2024
1 parent 456b090 commit 8e4ffb9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/src/pages/RunSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function RunSummary(): JSX.Element {
const localRobot = useSelector(getLocalRobot)
const robotName = localRobot?.name ?? 'no name'
const { trackProtocolRunEvent } = useTrackProtocolRunEvent(runId, robotName)
const { reset } = useRunControls(runId)
const { reset, isResetRunLoading } = useRunControls(runId)
const trackEvent = useTrackEvent()
const { closeCurrentRun, isClosingCurrentRun } = useCloseCurrentRun()
const robotAnalyticsData = useRobotAnalyticsData(robotName)
Expand Down Expand Up @@ -163,13 +163,15 @@ export function RunSummary(): JSX.Element {
setPipettesWithTip
).catch(e => console.log(`Error launching Tip Attachment Modal: ${e}`))
} else {
setShowRunAgainSpinner(true)
reset()
trackEvent({
name: 'proceedToRun',
properties: { sourceLocation: 'RunSummary' },
})
trackProtocolRunEvent({ name: ANALYTICS_PROTOCOL_RUN_AGAIN })
if (!isResetRunLoading) {
setShowRunAgainSpinner(true)
reset()
trackEvent({
name: 'proceedToRun',
properties: { sourceLocation: 'RunSummary' },
})
trackProtocolRunEvent({ name: ANALYTICS_PROTOCOL_RUN_AGAIN })
}
}
}

Expand Down

0 comments on commit 8e4ffb9

Please sign in to comment.