Skip to content

Commit

Permalink
Merge pull request #47269 from Expensify/marco-removePolicyIDsRouteParam
Browse files Browse the repository at this point in the history
[CP Staging] Remove policyIDs route param when workspace is deleted
  • Loading branch information
marcochavezf authored Aug 12, 2024
2 parents af9cd26 + ae8ad05 commit 4b30725
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import getAdaptedStateFromPath from '@libs/Navigation/linkingConfig/getAdaptedSt
import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
import type {RootStackParamList, State} from '@libs/Navigation/types';
import {isCentralPaneName} from '@libs/NavigationUtils';
import * as PolicyUtils from '@libs/PolicyUtils';
import {getCurrentSearchParams} from '@libs/SearchUtils';
import type {BrickRoad} from '@libs/WorkspacesSettingsUtils';
import {getChatTabBrickRoad} from '@libs/WorkspacesSettingsUtils';
Expand Down Expand Up @@ -90,7 +91,8 @@ function BottomTabBar({selectedTab}: BottomTabBarProps) {
const currentSearchParams = getCurrentSearchParams();
if (currentSearchParams) {
const {q, ...rest} = currentSearchParams;
Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: q, ...rest}));
const policy = PolicyUtils.getPolicy(currentSearchParams?.policyIDs);
Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: q, ...rest, policyIDs: policy ? currentSearchParams?.policyIDs : undefined}));
return;
}
Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: CONST.SEARCH.TAB.EXPENSE.ALL}));
Expand Down

0 comments on commit 4b30725

Please sign in to comment.