Skip to content

Commit

Permalink
Fixed sidenav logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Feb 26, 2024
1 parent 70e7ad8 commit cfdce69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/menu/side-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const SideNav = ({menuItems, currentPath}: { menuItems: MenuItemType[], currentP
const topMenuItem = activeTrail.length > 0 ? menuItems.find(item => item.id === activeTrail[0]) : undefined;
if (!topMenuItem) return null;

const subTree = topMenuItem.children || [];
const subTree = topMenuItem.children || undefined;

if (!subTree || (subTree.length <= 1 && !subTree[0].children)) {
if (!subTree || (subTree.length === 1 && !subTree[0].children)) {
return null;
}

Expand Down

0 comments on commit cfdce69

Please sign in to comment.