-
Notifications
You must be signed in to change notification settings - Fork 3k
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 FullScreenNavigator from the Home page #38734
Changes from 2 commits
a832c3e
fb61247
83fa85a
703c27e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,6 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam | |
} | ||
let root: NavigationRoot = navigation; | ||
let current: NavigationRoot | undefined; | ||
|
||
// Traverse up to get the root navigation | ||
// eslint-disable-next-line no-cond-assign | ||
while ((current = root.getParent())) { | ||
|
@@ -145,7 +144,6 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam | |
} | ||
|
||
const action: StackNavigationAction = getActionFromState(stateFromPath, linkingConfig.config); | ||
|
||
// If action type is different than NAVIGATE we can't change it to the PUSH safely | ||
if (action?.type === CONST.NAVIGATION.ACTION_TYPE.NAVIGATE) { | ||
const topmostCentralPaneRoute = getTopmostCentralPaneRoute(rootState); | ||
|
@@ -182,12 +180,11 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam | |
action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE; | ||
|
||
// If this action is navigating to the ModalNavigator and the last route on the root navigator is not already opened ModalNavigator then push | ||
} else if (isModalNavigator(action.payload.name) && !isTargetNavigatorOnTop) { | ||
} else if ((action.payload.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR || isModalNavigator(action.payload.name)) && !isTargetNavigatorOnTop) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, after this change, I can't open the workspace page on native and mWeb. Screen.Recording.2024-03-28.at.13.57.46.movThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi! Thanks for noticing that. I see that 2 days ago this PR was merged #38977. It has introduced some changes to the navigation logic. When I was working on this PR, these changes weren't merged yet. I'll try to adjust my fix :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Came here to point out the same issue |
||
if (isModalNavigator(topRouteName)) { | ||
dismissModal(navigation); | ||
} | ||
action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH; | ||
|
||
// If this RHP has mandatory central pane and bottom tab screens defined we need to push them. | ||
const {adaptedState, metainfo} = getAdaptedStateFromPath(path, linkingConfig.config); | ||
if (adaptedState && (metainfo.isCentralPaneAndBottomTabMandatory || metainfo.isFullScreenNavigatorMandatory)) { | ||
|
@@ -197,6 +194,10 @@ 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) { | ||
return; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
} else if (action.payload.name === NAVIGATORS.BOTTOM_TAB_NAVIGATOR) { | ||
// If path contains a policyID, we should invoke the navigate function | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to adjust this comment as well. And probably can move
action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;
after the return in the line 199. It's only for Modal navigators