Skip to content

Commit 905d73b

Browse files
waleedlatif1claude
andcommitted
fix(tour): stop running tour when disabled becomes true
Prevents nav and workflow tours from overlapping. When a user navigates to a workflow page while the nav tour is running, the disabled flag now stops the nav tour instead of just suppressing auto-start. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 85577eb commit 905d73b

File tree

1 file changed

+10
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/components/product-tour

1 file changed

+10
-0
lines changed

apps/sim/app/workspace/[workspaceId]/components/product-tour/use-tour.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ export function useTour({
132132
[steps.length, stopTour]
133133
)
134134

135+
/** Stop the tour when disabled becomes true (e.g. navigating away from the relevant page) */
136+
useEffect(() => {
137+
if (disabled && run) {
138+
setRun(false)
139+
setIsTooltipVisible(true)
140+
setIsEntrance(true)
141+
logger.info(`${tourName} paused — disabled became true`)
142+
}
143+
}, [disabled, run, tourName])
144+
135145
/** Auto-start on first visit */
136146
useEffect(() => {
137147
if (disabled || hasAutoStarted.current) return

0 commit comments

Comments
 (0)