From ae8ad05a3ed48b5fb2f1f61aa27abd7c57b2a80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 12 Aug 2024 16:14:08 -0600 Subject: [PATCH] chore: Remove policyIDs route param when workspace is deleted --- .../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}));