Skip to content

Commit

Permalink
Fix navigation error
Browse files Browse the repository at this point in the history
Signed-off-by: Tsaqif <[email protected]>
  • Loading branch information
tsa321 committed Aug 24, 2024
1 parent 9b093c7 commit dded728
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
},
});

Expand Down
6 changes: 4 additions & 2 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dded728

Please sign in to comment.