Skip to content

Commit

Permalink
fix(pnr): resolve routing undefined error
Browse files Browse the repository at this point in the history
ref: MANAGER-16441

Signed-off-by: Maxime Bajeux <[email protected]>
  • Loading branch information
Maxime Bajeux committed Dec 18, 2024
1 parent 263817e commit 186d28e
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ const Sidebar = (): JSX.Element => {
}
const currentNode: Node = selectedSubMenu || savedNode;

if (currentNode) {


if (currentNode?.routing) {
// We already stored a node, we want to know if it stills in coherence with the current path
// If not, we reset the node to null to not keep wrong information.
const universe = findNodeById(currentNavigationNode, currentNode.universe);
Expand Down Expand Up @@ -154,14 +156,11 @@ const Sidebar = (): JSX.Element => {
selectLvl1Node(universe)

return;
} else {
selectedNode ? selectLvl1Node(null) : setSavedNode(null);
}
} else {
selectedNode ? selectLvl1Node(null) : setSavedNode(null);
}
}

selectedNode ? selectLvl1Node(null) : setSavedNode(null);

// If we didn't have a stored node or if we have reset it,
// we search in the full navigation tree a node that could match the current path
const foundNode = findNodeByRouting(currentNavigationNode, pathname);
Expand Down

0 comments on commit 186d28e

Please sign in to comment.