Skip to content

Commit

Permalink
Fix types in linkTo
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Jan 29, 2024
1 parent c1b44f4 commit 0eb0d0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/Navigation/linkTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ 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 isNewPolicyID = topmostBottomTabRoute?.params?.policyID !== matchingBottomTabRoute?.params?.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)) {
root.dispatch({
type: CONST.NAVIGATION.ACTION_TYPE.PUSH,
Expand Down

0 comments on commit 0eb0d0d

Please sign in to comment.