From 6b52ab81d266ff10d9b7cb6d08414d69ad454662 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Wed, 15 Jun 2022 19:07:09 +0500 Subject: [PATCH] tweak state usage --- apps/mobile/src/components/header/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.js index 7a82f2ea3..26b3f62b3 100644 --- a/apps/mobile/src/components/header/index.js +++ b/apps/mobile/src/components/header/index.js @@ -17,7 +17,7 @@ export const Header = React.memo( const insets = useSafeAreaInsets(); const [hide, setHide] = useState(true); const selectionMode = useSelectionStore(state => state.selectionMode); - const currentScreen = useNavigationStore(state => state.currentScreen); + const currentScreen = useNavigationStore(state => state.currentScreen?.name); const onScroll = data => { if (data.y > 150) { @@ -51,7 +51,7 @@ export const Header = React.memo( } ]} > - {currentScreen.name === 'Search' ? ( + {currentScreen === 'Search' ? ( ) : ( <>