Skip to content

Commit

Permalink
Refactor comment in getDistanceFromPathInRootNavigator
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Jul 1, 2024
1 parent 44da559 commit eb55e34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ function getDistanceFromPathInRootNavigator(path?: string): number {
break;
}

// When paths are compared, they the policyID param should be excluded from the state. If it's present in currentState, pathFromState will include it and in result it will be different than the path value.
const currentStateWithoutParams = removePolicyIDParamFromState(currentState as State<RootStackParamList>);
const pathFromState = getPathFromState(currentStateWithoutParams, linkingConfig.config);
// When comparing path and pathFromState, the policyID parameter isn't included in the comparison
const currentStateWithoutPolicyID = removePolicyIDParamFromState(currentState as State<RootStackParamList>);
const pathFromState = getPathFromState(currentStateWithoutPolicyID, linkingConfig.config);
if (path === pathFromState.substring(1)) {
return index;
}
Expand Down

0 comments on commit eb55e34

Please sign in to comment.