From 49aa058ff100db7af35f890e7c472abae9deee11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 12 Aug 2024 17:24:07 -0600 Subject: [PATCH] Merge pull request #47269 from Expensify/marco-removePolicyIDsRouteParam [CP Staging] Remove policyIDs route param when workspace is deleted (cherry picked from commit 4b30725055e42558ab381f1d64f6f0b25288839c) (CP triggered by Beamanator) --- .../createCustomBottomTabNavigator/BottomTabBar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx index f06757793d8b..f023e94bec9b 100644 --- a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx @@ -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'; @@ -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}));