From 67091e9d1311c357bb249a59568ea75bb1e9a22c Mon Sep 17 00:00:00 2001 From: talksik Date: Mon, 13 Apr 2026 09:06:22 -0700 Subject: [PATCH] fix: prevent exit countdown on playback blocked --- js/src/features/particles/stream-view.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/src/features/particles/stream-view.tsx b/js/src/features/particles/stream-view.tsx index 3e61b21..f9f2ad0 100644 --- a/js/src/features/particles/stream-view.tsx +++ b/js/src/features/particles/stream-view.tsx @@ -41,7 +41,7 @@ type PlaybackStatus = "idle" | "playing" | "ended"; function useExitCountdown( status: PlaybackStatus, - composeActive: boolean, + disabled: boolean, onExit: () => void, ) { const [remainingMs, setRemainingMs] = useState(null); @@ -61,7 +61,7 @@ function useExitCountdown( // Tick the countdown down (pauses when compose is active) useEffect(() => { - if (remainingMs === null || remainingMs <= 0 || composeActive) return; + if (remainingMs === null || remainingMs <= 0 || disabled) return; const interval = setInterval(() => { setRemainingMs((prev) => { @@ -72,7 +72,7 @@ function useExitCountdown( }, EXIT_TICK_MS); return () => clearInterval(interval); - }, [remainingMs !== null && remainingMs > 0, composeActive]); + }, [remainingMs !== null && remainingMs > 0, disabled]); // Navigate once countdown hits zero useEffect(() => { @@ -237,7 +237,7 @@ function StreamViewInner({ path, streamParticle }: StreamViewProps) { const exitRemainingMs = useExitCountdown( status, - composeActive, + playbackBlocked, handleExitNavigate, );