Skip to content

Commit

Permalink
Merge pull request Expensify#50504 from bernhardoj/fix/50155-incorrec…
Browse files Browse the repository at this point in the history
…t-rhp-matching-screen

Fix report screen changes to profile view when clicking Country field
  • Loading branch information
rlinoz authored Oct 10, 2024
2 parents 8f5ba1e + b3a0e38 commit 273b47e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ function getMatchingRootRouteForRHPRoute(route: NavigationPartialRoute): Navigat
// If there is rhpNavigator in the state generated for backTo url, we want to get root route matching to this rhp screen.
const rhpNavigator = stateForBackTo.routes.find((rt) => rt.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR);
if (rhpNavigator && rhpNavigator.state) {
const isRHPinState = stateForBackTo.routes.at(0)?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR;

if (isRHPinState) {
return getMatchingRootRouteForRHPRoute(findFocusedRoute(stateForBackTo) as NavigationPartialRoute);
}
return getMatchingRootRouteForRHPRoute(findFocusedRoute(stateForBackTo) as NavigationPartialRoute);
}

// If we know that backTo targets the root route (full screen) we want to use it.
Expand Down

0 comments on commit 273b47e

Please sign in to comment.