diff --git a/packages/manager/apps/container/src/container/nav-reshuffle/sidebar/index.tsx b/packages/manager/apps/container/src/container/nav-reshuffle/sidebar/index.tsx index 5e61bb41b2e2..b82818f51e6d 100644 --- a/packages/manager/apps/container/src/container/nav-reshuffle/sidebar/index.tsx +++ b/packages/manager/apps/container/src/container/nav-reshuffle/sidebar/index.tsx @@ -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); @@ -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); diff --git a/yarn.lock b/yarn.lock index ca8af8f6d072..0c649a970a4b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9928,15 +9928,6 @@ test-exclude "^7.0.1" tinyrainbow "^1.2.0" -"@vitest/expect@1.3.1": - 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/expect@1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-1.4.0.tgz#d64e17838a20007fecd252397f9b96a1ca81bfb0" @@ -10154,13 +10145,6 @@ magic-string "^0.30.12" pathe "^1.1.2" -"@vitest/spy@1.3.1": - 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/spy@1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-1.4.0.tgz#cf953c93ae54885e801cbe6b408a547ae613f26c"