Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoPress: fix render player once file uploads issue #28296

Merged
merged 2 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

VideoPress: fix render player once file uploads issue
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export default function VideoPressEdit( {
*/
const [ generatingPreviewCounter, setGeneratingPreviewCounter ] = useState( 0 );

const rePreviewAttemptTimer = useRef< NodeJS.Timeout >();
const rePreviewAttemptTimer = useRef< NodeJS.Timeout | void >();

/**
* Clean the generating process timer.
Expand All @@ -277,7 +277,11 @@ export default function VideoPressEdit( {
return;
}

clearInterval( rePreviewAttemptTimer.current );
/*
* Clean the timer, and updates the reference
* to force a new attempt in case the preview is not available.
*/
rePreviewAttemptTimer.current = clearInterval( rePreviewAttemptTimer.current );
}

useEffect( () => {
Expand Down