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:
parent
37593dd4bc
commit
0a79a82b04
1 changed files with 1 additions and 1 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue