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(() => {
|
||||
if (!claimThumbnail) return;
|
||||
|
||||
setTimeout(() => {
|
||||
const timer = setTimeout(() => {
|
||||
let newThumbnail = claimThumbnail;
|
||||
|
||||
if (
|
||||
|
@ -128,6 +128,8 @@ export default function FileRenderInitiator(props: Props) {
|
|||
setThumbnail(newThumbnail);
|
||||
}
|
||||
}, 200);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, [claimThumbnail, thumbnail]);
|
||||
|
||||
function handleClick() {
|
||||
|
|
Loading…
Reference in a new issue