Skip to content

Commit

Permalink
fix(app): fix never clicking setup tab after the run has started
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Aug 20, 2024
1 parent 681a4c2 commit 76fbbec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/pages/Devices/ProtocolRunDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,12 @@ const SetupTab = (props: SetupTabProps): JSX.Element | null => {
'not_available_for_a_completed_run'
)}`

// On the initial render only, navigate to "run preview" if the run has started.
React.useEffect(() => {
if (runHasStarted && protocolRunDetailsTab === 'setup') {
navigate(`/devices/${robotName}/protocol-runs/${runId}/run-preview`)
}
}, [runHasStarted, navigate, protocolRunDetailsTab, robotName, runId])
}, [])

return (
<RoundTab
Expand Down

0 comments on commit 76fbbec

Please sign in to comment.