Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opening workspace settings on small screen #39150

Merged
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: 5 additions & 3 deletions src/libs/Navigation/linkTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
const policyIDFromState = getPolicyIDFromState(rootState);
const policyID = extractedPolicyID ?? policyIDFromState;

const isNarrowLayout = getIsNarrowLayout();

const isFullScreenOnTop = rootState.routes?.at(-1)?.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR;

if (policyID && !isFullScreenOnTop) {
Expand Down Expand Up @@ -194,8 +196,8 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
root.dispatch(diffAction);
}
}
// All actions related to FullScreenNavigator are pushed when comparing differences between rootState and adaptedState.
if (action.payload.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR) {
// All actions related to FullScreenNavigator on wide screen are pushed when comparing differences between rootState and adaptedState.
if (action.payload.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR && !isNarrowLayout) {
return;
}
action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;
Expand All @@ -213,7 +215,7 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
root.dispatch(actionForBottomTabNavigator);

// If the layout is wide we need to push matching central pane route to the stack.
if (!getIsNarrowLayout()) {
if (!isNarrowLayout) {
// stateFromPath should always include bottom tab navigator state, so getMatchingCentralPaneRouteForState will be always defined.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const matchingCentralPaneRoute = getMatchingCentralPaneRouteForState(stateFromPath, rootState)!;
Expand Down
Loading