Skip to content

Commit

Permalink
remove useless code and update logic dismiss modal
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Aug 16, 2024
1 parent 8af7d33 commit 06a9081
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libs/Navigation/linkTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
}

if (type === CONST.NAVIGATION.TYPE.UP) {
if (!areParamsDifferent && isSideModalNavigator(lastRoute?.name) && topmostCentralPaneRoute?.name === targetName) {
dismissModal(navigation);
return;
}
action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE;
} else {
action.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;
Expand All @@ -127,6 +123,10 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
// 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
// and at the same time we want the back button to go to the page we were before the deeplink
} else if (type === CONST.NAVIGATION.TYPE.UP) {
if (!areParamsDifferent && isSideModalNavigator(lastRoute?.name) && topmostCentralPaneRoute?.name === targetName) {
dismissModal(navigation);
return;
}
action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE;

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

0 comments on commit 06a9081

Please sign in to comment.