diff --git a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx index e0a9917a6fbe..a672d211c98e 100644 --- a/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx @@ -12,13 +12,15 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Session from '@libs/actions/Session'; import interceptAnonymousUser from '@libs/interceptAnonymousUser'; -import Navigation from '@libs/Navigation/Navigation'; +import getAdaptedStateFromPath from '@libs/Navigation/linkingConfig/getAdaptedStateFromPath'; +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'; +import linkingConfig from '@navigation/linkingConfig'; import BottomTabAvatar from '@pages/home/sidebar/BottomTabAvatar'; import BottomTabBarFloatingActionButton from '@pages/home/sidebar/BottomTabBarFloatingActionButton'; import variables from '@styles/variables'; @@ -65,8 +67,8 @@ function BottomTabBar({selectedTab}: BottomTabBarProps) { Welcome.isOnboardingFlowCompleted({ onNotCompleted: () => { - Navigation.resetToHome(); - Navigation.navigate(Welcome.getOnboardingInitialPath()); + const {adaptedState} = getAdaptedStateFromPath(Welcome.getOnboardingInitialPath(), linkingConfig.config); + navigationRef.resetRoot(adaptedState); }, }); diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index b88634b50e23..9c57c178ec1c 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -64,6 +64,7 @@ import isPublicScreenRoute from '@libs/isPublicScreenRoute'; import * as Localize from '@libs/Localize'; import Log from '@libs/Log'; import {registerPaginationConfig} from '@libs/Middleware/Pagination'; +import getAdaptedStateFromPath from '@libs/Navigation/linkingConfig/getAdaptedStateFromPath'; import Navigation, {navigationRef} from '@libs/Navigation/Navigation'; import {isOnboardingFlowName} from '@libs/NavigationUtils'; import type {NetworkStatus} from '@libs/NetworkConnection'; @@ -82,6 +83,7 @@ import * as ReportUtils from '@libs/ReportUtils'; import {doesReportBelongToWorkspace} from '@libs/ReportUtils'; import shouldSkipDeepLinkNavigation from '@libs/shouldSkipDeepLinkNavigation'; import Visibility from '@libs/Visibility'; +import linkingConfig from '@navigation/linkingConfig'; import CONFIG from '@src/CONFIG'; import type {OnboardingPurposeType} from '@src/CONST'; import CONST from '@src/CONST'; @@ -2702,8 +2704,8 @@ function openReportFromDeepLink(url: string) { if (!hasCompletedGuidedSetupFlow) { Welcome.isOnboardingFlowCompleted({ onNotCompleted: () => { - Navigation.resetToHome(); - Navigation.navigate(Welcome.getOnboardingInitialPath()); + const {adaptedState} = getAdaptedStateFromPath(Welcome.getOnboardingInitialPath(), linkingConfig.config); + navigationRef.resetRoot(adaptedState); }, }); return;