Skip to content

Commit

Permalink
Fix matchingBottomTabRoute in linkTo
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Jan 29, 2024
1 parent d87cff1 commit 98cd8b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/Navigation/linkTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
) {
// 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 matchingBottomTabRoute = policyID ? getMatchingBottomTabRouteForState(stateFromPath, policyID) : getMatchingBottomTabRouteForState(stateFromPath);
const matchingBottomTabRoute = getMatchingBottomTabRouteForState(stateFromPath, policyID);
const isNewPolicyID =
(topmostBottomTabRoute?.params as Record<string, string | undefined>)?.policyID !== (matchingBottomTabRoute?.params as Record<string, string | undefined>)?.policyID;
if (topmostBottomTabRoute && (topmostBottomTabRoute.name !== matchingBottomTabRoute.name || isNewPolicyID)) {
Expand Down

0 comments on commit 98cd8b4

Please sign in to comment.