From 9a61f72e7644240027fb6a78043cbe06d5ab3e45 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 5 Jun 2024 10:12:32 +0800 Subject: [PATCH] prioritize central pane screen case over UP --- src/libs/Navigation/linkTo/index.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libs/Navigation/linkTo/index.ts b/src/libs/Navigation/linkTo/index.ts index b9839483a056..424856c1fafc 100644 --- a/src/libs/Navigation/linkTo/index.ts +++ b/src/libs/Navigation/linkTo/index.ts @@ -80,13 +80,8 @@ export default function linkTo(navigation: NavigationContainerRef | undefined, (value) => value === undefined), ); - // 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 - if (type === CONST.NAVIGATION.TYPE.UP) { - action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE; - - // If this action is navigating to the report screen and the top most navigator is different from the one we want to navigate - PUSH the new screen to the top of the stack - } else if (action.payload.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR && (isTargetScreenDifferentThanCurrent || areParamsDifferent)) { + // If this action is navigating to the report screen and the top most navigator is different from the one we want to navigate - PUSH the new screen to the top of the stack by default + if (action.payload.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR && (isTargetScreenDifferentThanCurrent || areParamsDifferent)) { // We need to push a tab if the tab doesn't match the central pane route that we are going to push. const topmostBottomTabRoute = getTopmostBottomTabRoute(rootState); const policyIDsFromState = extractPolicyIDsFromState(stateFromPath); @@ -100,13 +95,22 @@ export default function linkTo(navigation: NavigationContainerRef