Skip to content

Commit

Permalink
Fix navigating from BottomTabAvatar when current route is WorkspaceIn…
Browse files Browse the repository at this point in the history
…itialPage
  • Loading branch information
WojtekBoman committed Sep 26, 2024
1 parent 0283fa5 commit 8fff355
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/home/sidebar/BottomTabAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ function BottomTabAvatar({isCreateMenuOpen = false, isSelected = false}: BottomT
}

if (route.name === SCREENS.WORKSPACE.INITIAL) {
Navigation.dismissModal();
const previousRoute = navigationRef.getRootState().routes.at(-2);

// If there is the settings split navigator we can dismiss safely
if (previousRoute?.name === NAVIGATORS.SETTINGS_SPLIT_NAVIGATOR) {
Navigation.dismissModal();
} else {
// If not, we are going to replace this route with the settings route
Navigation.navigate(ROUTES.SETTINGS_WORKSPACES, CONST.NAVIGATION.ACTION_TYPE.REPLACE);
}
return;
}

Expand Down

0 comments on commit 8fff355

Please sign in to comment.