Skip to content

Commit

Permalink
Fix: The entire page blinks when clicking Inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
truph01 committed Jun 27, 2024
1 parent 9d8e7fe commit f465999
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View style={styles.bottomTabBarContainer}>
Expand Down Expand Up @@ -101,6 +104,9 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps
<Tooltip text={translate('common.search')}>
<PressableWithFeedback
onPress={() => {
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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View style={styles.bottomTabBarContainer}>
Expand Down Expand Up @@ -102,6 +105,9 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps
<Tooltip text={translate('common.search')}>
<PressableWithFeedback
onPress={() => {
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}
Expand Down

0 comments on commit f465999

Please sign in to comment.