fix: resolve race condition preventing captions in batch uploads

The video event listener effect had an empty dependency array, causing it
to run only once on mount. For batch uploads where downloads load slower,
the video element wasn't rendered yet when the effect ran, so listeners
were never attached. Adding currentVideoUrl as a dependency ensures the
effect re-runs when the video becomes available.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
michael 2025-12-29 10:59:30 -06:00
parent 37593dd4bc
commit 0a79a82b04

View file

@ -209,7 +209,7 @@ export function VideoReviewPlayer({ job, downloads }: VideoReviewPlayerProps) {
video.removeEventListener('pause', handlePause);
clearTimeout(timeoutId);
};
}, []); // Only run once on mount - video element is stable
}, [currentVideoUrl]); // Re-run when video URL changes to ensure listeners are attached
// Reset video when tab changes
useEffect(() => {