diff --git a/shell-ui/src/navbar/NavBar.tsx b/shell-ui/src/navbar/NavBar.tsx index 944891350e..0794bc0a1c 100644 --- a/shell-ui/src/navbar/NavBar.tsx +++ b/shell-ui/src/navbar/NavBar.tsx @@ -159,22 +159,18 @@ export const useNavbarLinksToActions = ( .sort((a, b) => { if (!a.view.isFederated || !b.view.isFederated) { return 0; - } - if (a.view.view.path === '/') { - return -1; - } - if (a.view.view.exact && !b.view.view.exact) { - return -1; - } - if (!a.view.view.exact && b.view.view.exact) { - return 1; - } - if (a.view.view.strict && !b.view.view.strict) { + } else if ( + (a.view.view.exact && !b.view.view.exact) || + (a.view.view.strict && !b.view.view.strict) + ) { return -1; - } - if (!a.view.view.strict && b.view.view.strict) { + } else if ( + (!a.view.view.exact && b.view.view.exact) || + (!a.view.view.strict && b.view.view.strict) + ) { return 1; } + return 0; }) .find((link) =>