Prevent undesired image blur captures

This commit is contained in:
Sam Becker 2024-03-11 17:19:02 -05:00
parent 57a4c17d0f
commit 5cd8054a8d

View File

@ -83,7 +83,10 @@ export default function CanvasBlurCapture({
// Store timeout ref to ensure it's closed over
// in cleanup function (recommended by exhaustive-deps)
const timeouts = refTimeouts.current;
return () => timeouts.forEach(clearTimeout);
return () => {
refShouldCapture.current = false;
timeouts.forEach(clearTimeout);
};
}, [
imageUrl,
onCapture,