Skip to content

Commit

Permalink
fix(app): fix ODD "run again" routing
Browse files Browse the repository at this point in the history
Clicking "run again" repeatedly causes multiple cloneRun hooks to fire, resulting in sometimes
bizzare routing scenarios. If a cloneRun is in progress, do not let another cloneRun occur.
  • Loading branch information
mjhuff committed Mar 19, 2024
1 parent b2e9b7b commit fcbd0bb
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 fcbd0bb

Please sign in to comment.