Fix player crash: remove premature pollForFile in handleDownloadAndPlay
The unified effect already gates polling on dlStatus===complete, but handleDownloadAndPlay was still calling pollForFile immediately on click, before the download even started. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -720,8 +720,7 @@ export default function Watch() {
|
|||||||
const handleDownloadAndPlay = useCallback(() => {
|
const handleDownloadAndPlay = useCallback(() => {
|
||||||
setPlayRequested(true);
|
setPlayRequested(true);
|
||||||
downloadMut.mutate();
|
downloadMut.mutate();
|
||||||
pollForFile(`/files/${youtubeVideoId}.mp4`);
|
}, [downloadMut]);
|
||||||
}, [downloadMut, pollForFile, youtubeVideoId]);
|
|
||||||
|
|
||||||
const saveProgress = useCallback((secs) => {
|
const saveProgress = useCallback((secs) => {
|
||||||
if (!video?.id) return;
|
if (!video?.id) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user