Skip to content

Commit 5f50430

Browse files
authored
Merge pull request #41317 from nkdengineer/fix/40743
fix: back arrow twice to return to LHN
2 parents 57d2aee + 4114956 commit 5f50430

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libs/Navigation/linkTo.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {getActionFromState} from '@react-navigation/core';
22
import type {NavigationAction, NavigationContainerRef, NavigationState, PartialState} from '@react-navigation/native';
3+
import {omitBy} from 'lodash';
34
import type {Writable} from 'type-fest';
45
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
56
import shallowCompare from '@libs/ObjectUtils';
@@ -153,8 +154,10 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
153154
const isTargetNavigatorOnTop = topRouteName === action.payload.name;
154155

155156
const isTargetScreenDifferentThanCurrent = Boolean(topmostCentralPaneRoute && topmostCentralPaneRoute.name !== action.payload.params?.screen);
156-
const areParamsDifferent = !shallowCompare(topmostCentralPaneRoute?.params, action.payload.params?.params);
157-
157+
const areParamsDifferent = !shallowCompare(
158+
omitBy(topmostCentralPaneRoute?.params, (value) => value === undefined),
159+
omitBy(action.payload.params?.params, (value) => value === undefined),
160+
);
158161
// In case if type is 'FORCED_UP' we replace current screen with the provided. This means the current screen no longer exists in the stack
159162
if (type === CONST.NAVIGATION.TYPE.FORCED_UP) {
160163
action.type = CONST.NAVIGATION.ACTION_TYPE.REPLACE;

0 commit comments

Comments
 (0)