From 1f3a3b6c39ce149c286ab4230303c27f0e8408c9 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:41:49 +0100 Subject: [PATCH] Auto hide "tap zone layout" preview when opening reader --- src/modules/reader/screens/Reader.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/reader/screens/Reader.tsx b/src/modules/reader/screens/Reader.tsx index 1f255509..a4237b87 100644 --- a/src/modules/reader/screens/Reader.tsx +++ b/src/modules/reader/screens/Reader.tsx @@ -283,6 +283,7 @@ const BaseReader = ({ const previousReadingMode = useRef(); const previousTapZoneLayout = useRef(); const previousTapZoneInvertMode = useRef(); + const isInitialPreview = useRef(true); useEffect(() => { const mangaFromResponse = mangaResponse.data?.manga; if (!mangaFromResponse || defaultSettingsResponse.loading || defaultSettingsResponse.error) { @@ -302,9 +303,14 @@ const BaseReader = ({ const showTapZoneLayoutPreview = shouldShowTapZoneLayoutPreview && didTapZoneLayoutChange; if (showTapZoneLayoutPreview) { setShowPreview(true); + if (isInitialPreview.current) { + setTimeout(() => setShowPreview(false), 5000); + } } previousTapZoneLayout.current = tapZoneLayout; previousTapZoneInvertMode.current = tapZoneInvertMode; + + isInitialPreview.current = false; }, [ readingMode.value, readingMode.isDefault,