From 6a32395234d593638ad18ff6528404770ada122e Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 30 Dec 2024 16:32:30 +0100 Subject: [PATCH] Always show "tap zone layout" preview when necessary In case the "tap zone layout" setting value got changed from or to the same value as the default value, the preview was never shown due to the canvas being reused and therefore not triggering the useEffect --- src/modules/reader/components/TapZoneLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/reader/components/TapZoneLayout.tsx b/src/modules/reader/components/TapZoneLayout.tsx index 58890969..56363f7d 100644 --- a/src/modules/reader/components/TapZoneLayout.tsx +++ b/src/modules/reader/components/TapZoneLayout.tsx @@ -52,7 +52,7 @@ const BaseTapZoneLayout = ({ useLayoutEffect(() => { const canvasContainerElement = document.getElementById(CANVAS_ID); canvasContainerElement?.replaceChildren(canvas); - }, [canvas]); + }, [canvas, showPreview]); return (