From eb55e3452f10c81bb51fcef31aa751aab9a6822b Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Mon, 1 Jul 2024 09:33:18 +0200 Subject: [PATCH] Refactor comment in getDistanceFromPathInRootNavigator --- src/libs/Navigation/Navigation.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index bc8fd9db1b71..e9bfb7227403 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -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); - 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); + const pathFromState = getPathFromState(currentStateWithoutPolicyID, linkingConfig.config); if (path === pathFromState.substring(1)) { return index; }