From 06399fe3bd28a0889e0dbc4144bf9f3ecddb5012 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Wed, 22 Mar 2023 15:02:55 +0500 Subject: [PATCH] mobile: fix title hidden on navigate sometimes --- apps/mobile/app/components/header/title.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/mobile/app/components/header/title.js b/apps/mobile/app/components/header/title.js index 15e762623..54ba64e3a 100644 --- a/apps/mobile/app/components/header/title.js +++ b/apps/mobile/app/components/header/title.js @@ -63,13 +63,15 @@ export const Title = () => { } if (data.y > 150) { if (!hide) return; + titleState[currentScreen.id] = false; setHide(false); } else { if (hide) return; + titleState[currentScreen.id] = true; setHide(true); } }, - [currentScreen.name, hide] + [currentScreen.id, currentScreen.name, hide] ); useEffect(() => { @@ -84,10 +86,6 @@ export const Title = () => { } }, [currentScreen.id, currentScreen.name]); - useEffect(() => { - titleState[currentScreen.id] = hide; - }, [currentScreen.id, hide]); - useEffect(() => { eSubscribeEvent(eScrollEvent, onScroll); return () => {