Skip to content

Commit 212750d

Browse files
authored
Merge pull request #47541 from nkdengineer/fix/47259
fix: Back button on expense report reopens same report
2 parents c0a9cbf + 06a9081 commit 212750d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libs/Navigation/linkTo/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
123123
// If the type is UP, we deeplinked into one of the RHP flows and we want to replace the current screen with the previous one in the flow
124124
// and at the same time we want the back button to go to the page we were before the deeplink
125125
} else if (type === CONST.NAVIGATION.TYPE.UP) {
126+
if (!areParamsDifferent && isSideModalNavigator(lastRoute?.name) && topmostCentralPaneRoute?.name === targetName) {
127+
dismissModal(navigation);
128+
return;
129+
}
126130
action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE;
127131

128132
// If this action is navigating to ModalNavigator or FullScreenNavigator and the last route on the root navigator is not already opened Navigator then push

0 commit comments

Comments
 (0)