Skip to content

Commit

Permalink
fix BottomTabBar to handle policyID when navigating to search
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicu committed Aug 27, 2024
1 parent b03789b commit a68d9af
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ function BottomTabBar({selectedTab}: BottomTabBarProps) {
);
return;
}
Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: SearchUtils.buildCannedSearchQuery()}));

// Fixme add policyID
// const query = activeWorkspaceID ? `${CONST.SEARCH.TAB.EXPENSE.ALL} policyID:${activeWorkspaceID}` : CONST.SEARCH.TAB.EXPENSE.ALL;
// Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query}));
const defaultCannedQuery = SearchUtils.buildCannedSearchQuery();
// when navigating to search we might have an activePolicyID set from workspace switcher
const query = activeWorkspaceID ? `${defaultCannedQuery} ${CONST.SEARCH.SYNTAX_ROOT_KEYS.POLICY_ID}:${activeWorkspaceID}` : defaultCannedQuery;
Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query}));
});
}, [activeWorkspaceID, selectedTab]);

Expand Down

0 comments on commit a68d9af

Please sign in to comment.