Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ function BottomTabBar({isLoadingApp = false}: PurposeForUsingExpensifyModalProps
const navigationState = navigation.getState();
const routes = navigationState.routes;
const currentRoute = routes[navigationState.index];

if (currentRoute && currentRoute.name !== NAVIGATORS.BOTTOM_TAB_NAVIGATOR && currentRoute.name !== NAVIGATORS.CENTRAL_PANE_NAVIGATOR) {
const bottomTabRoute = getTopmostBottomTabRoute(navigationState);
if (
// When we are redirected to the Settings tab from the OldDot, we don't want to call the Welcome.show() method.
// To prevent this, the value of the bottomTabRoute?.name is checked here
bottomTabRoute?.name === SCREENS.WORKSPACE.INITIAL ||
(currentRoute && currentRoute.name !== NAVIGATORS.BOTTOM_TAB_NAVIGATOR && currentRoute.name !== NAVIGATORS.CENTRAL_PANE_NAVIGATOR)
) {
return;
}

Expand Down
4 changes: 1 addition & 3 deletions src/libs/actions/Welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,11 @@ function show(routes: NavigationState<RootStackParamList>['routes'], showEngagem
const transitionRoute = routes.find(
(route): route is NavigationState<Pick<RootStackParamList, typeof SCREENS.TRANSITION_BETWEEN_APPS>>['routes'][number] => route.name === SCREENS.TRANSITION_BETWEEN_APPS,
);
const activeRoute = Navigation.getActiveRouteWithoutParams();
const isOnWorkspaceOverviewPage = activeRoute?.startsWith('/workspace') && activeRoute?.endsWith('/overview');
const isExitingToWorkspaceRoute = transitionRoute?.params?.exitTo === 'workspace/new';

// If we already opened the workspace settings or want the admin room to stay open, do not
// navigate away to the workspace chat report
const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute && !isOnWorkspaceOverviewPage;
const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute;

const workspaceChatReport = Object.values(allReports ?? {}).find((report) => {
if (report) {
Expand Down