From f465999b93a5b76b9a7f1575197cc64c531b0e5f Mon Sep 17 00:00:00 2001 From: truph01 Date: Thu, 27 Jun 2024 16:47:42 +0700 Subject: [PATCH] Fix: The entire page blinks when clicking Inbox --- .../createCustomBottomTabNavigator/BottomTabBar/index.tsx | 8 +++++++- .../BottomTabBar/index.website.tsx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.tsx b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.tsx index 472d2c7d6d29..d1a4ebde0c84 100644 --- a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.tsx @@ -71,9 +71,12 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps const chatTabBrickRoad = getChatTabBrickRoad(activeWorkspaceID); const navigateToChats = useCallback(() => { + if (currentTabName === SCREENS.HOME) { + return; + } const route = activeWorkspaceID ? (`/w/${activeWorkspaceID}/home` as Route) : ROUTES.HOME; Navigation.navigate(route); - }, [activeWorkspaceID]); + }, [activeWorkspaceID, currentTabName]); return ( @@ -101,6 +104,9 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps { + if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB || currentTabName === SCREENS.SEARCH.CENTRAL_PANE) { + return; + } interceptAnonymousUser(() => Navigation.navigate(ROUTES.SEARCH.getRoute(CONST.SEARCH.TAB.ALL))); }} role={CONST.ROLE.BUTTON} diff --git a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.website.tsx b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.website.tsx index 9fe78273bdb0..ecacedde16dd 100644 --- a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.website.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.website.tsx @@ -72,9 +72,12 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps const chatTabBrickRoad = getChatTabBrickRoad(activeWorkspaceID); const navigateToChats = useCallback(() => { + if (currentTabName === SCREENS.HOME) { + return; + } const route = activeWorkspaceID ? (`/w/${activeWorkspaceID}/home` as Route) : ROUTES.HOME; Navigation.navigate(route); - }, [activeWorkspaceID]); + }, [activeWorkspaceID, currentTabName]); return ( @@ -102,6 +105,9 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps { + if (currentTabName === SCREENS.SEARCH.BOTTOM_TAB || currentTabName === SCREENS.SEARCH.CENTRAL_PANE) { + return; + } interceptAnonymousUser(() => Navigation.navigate(ROUTES.SEARCH.getRoute(CONST.SEARCH.TAB.ALL))); }} role={CONST.ROLE.BUTTON}