From 5cd8054a8d24ccde22b9dfc6e03fca1b39d7ff73 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 11 Mar 2024 17:19:02 -0500 Subject: [PATCH] Prevent undesired image blur captures --- src/components/CanvasBlurCapture.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/CanvasBlurCapture.tsx b/src/components/CanvasBlurCapture.tsx index a47d6a2a..ce66d3de 100644 --- a/src/components/CanvasBlurCapture.tsx +++ b/src/components/CanvasBlurCapture.tsx @@ -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,