Skip to content

Commit

Permalink
Fix switching between home and workspace settings
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Sep 26, 2024
1 parent 9a61e4d commit 0283fa5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/pages/home/sidebar/BottomTabAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import interceptAnonymousUser from '@libs/interceptAnonymousUser';
import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
import type {AuthScreensParamList} from '@libs/Navigation/types';
import type {WorkspaceSplitNavigatorParamList} from '@libs/Navigation/types';
import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -61,11 +61,10 @@ function BottomTabAvatar({isCreateMenuOpen = false, isSelected = false}: BottomT

// If there is a workspace navigator route, then we should open the workspace initial screen as it should be "remembered".
if (lastSettingsOrWorkspaceNavigatorRoute?.name === NAVIGATORS.WORKSPACE_SPLIT_NAVIGATOR) {
const params = lastSettingsOrWorkspaceNavigatorRoute.params as AuthScreensParamList[typeof NAVIGATORS.WORKSPACE_SPLIT_NAVIGATOR];

const params = lastSettingsOrWorkspaceNavigatorRoute.state?.routes.at(0)?.params as WorkspaceSplitNavigatorParamList[typeof SCREENS.WORKSPACE.INITIAL];
// Screens of this navigator should always have policyID
if ('params' in params && params.params?.policyID) {
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(params.params.policyID));
if (params.policyID) {
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(params.policyID));
}
return;
}
Expand Down

0 comments on commit 0283fa5

Please sign in to comment.