fileRenderInitiator: missing timer cleanup
This commit is contained in:
parent
32d5eaf8e1
commit
7dd7aac8d2
1 changed files with 3 additions and 1 deletions
|
@ -112,7 +112,7 @@ export default function FileRenderInitiator(props: Props) {
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!claimThumbnail) return;
|
if (!claimThumbnail) return;
|
||||||
|
|
||||||
setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
let newThumbnail = claimThumbnail;
|
let newThumbnail = claimThumbnail;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -128,6 +128,8 @@ export default function FileRenderInitiator(props: Props) {
|
||||||
setThumbnail(newThumbnail);
|
setThumbnail(newThumbnail);
|
||||||
}
|
}
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
}, [claimThumbnail, thumbnail]);
|
}, [claimThumbnail, thumbnail]);
|
||||||
|
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
|
|
Loading…
Reference in a new issue