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 13, 2024
1 parent d63d706 commit ff7efd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 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
16 changes: 0 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9928,15 +9928,6 @@
test-exclude "^7.0.1"
tinyrainbow "^1.2.0"

"@vitest/[email protected]":
version "1.3.1"
resolved "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz#d4c14b89c43a25fd400a6b941f51ba27fe0cb918"
integrity sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==
dependencies:
"@vitest/spy" "1.3.1"
"@vitest/utils" "1.3.1"
chai "^4.3.10"

"@vitest/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-1.4.0.tgz#d64e17838a20007fecd252397f9b96a1ca81bfb0"
Expand Down Expand Up @@ -10154,13 +10145,6 @@
magic-string "^0.30.12"
pathe "^1.1.2"

"@vitest/[email protected]":
version "1.3.1"
resolved "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz#814245d46d011b99edd1c7528f5725c64e85a88b"
integrity sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==
dependencies:
tinyspy "^2.2.0"

"@vitest/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-1.4.0.tgz#cf953c93ae54885e801cbe6b408a547ae613f26c"
Expand Down

0 comments on commit ff7efd0

Please sign in to comment.