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
8 changes: 6 additions & 2 deletions src/components/Navigation/NavigationTabBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {View} from 'react-native';
import type {ValueOf} from 'type-fest';
import HeaderGap from '@components/HeaderGap';
import Icon from '@components/Icon';
// import * as Expensicons from '@components/Icon/Expensicons';
Comment thread
sumo-slonik marked this conversation as resolved.
Resolved
import ImageSVG from '@components/ImageSVG';
import DebugTabView from '@components/Navigation/DebugTabView';
import {PressableWithFeedback} from '@components/Pressable';
Expand Down Expand Up @@ -122,8 +121,13 @@ function NavigationTabBar({selectedTab, isTopLevelBar = false}: NavigationTabBar
return;
}

if (!shouldUseNarrowLayout && isRoutePreloaded(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)) {
navigationRef.dispatch(StackActions.push(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR));
return;
}

Navigation.navigate(ROUTES.HOME);
}, [selectedTab]);
}, [selectedTab, shouldUseNarrowLayout]);

const navigateToSearch = useCallback(() => {
if (selectedTab === NAVIGATION_TABS.SEARCH) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {getPreservedNavigatorState} from './createSplitNavigator/usePreserveNavi
// This timing is used to call the preload function after a tab change, when the initial tab screen has already been rendered.
const TIMING_TO_CALL_PRELOAD = 1000;

// Currently, only the Account and Workspaces tabs are preloaded. The remaining tabs will be supported soon.
const TABS_TO_PRELOAD = [NAVIGATION_TABS.SETTINGS, NAVIGATION_TABS.WORKSPACES];
// Currently, only the Inbox, Workspaces, Account tabs are preloaded. The remaining tabs will be supported soon.
const TABS_TO_PRELOAD = [NAVIGATION_TABS.HOME, NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.SETTINGS];

function preloadWorkspacesTab(navigation: PlatformStackNavigationProp<AuthScreensParamList>) {
const state = getWorkspacesTabStateFromSessionStorage() ?? navigation.getState();
Expand Down