Skip to content

Commit

Permalink
Merge pull request #518 from actiontech/fix/nav-menu
Browse files Browse the repository at this point in the history
[fix](Nav): Fix menu children errors
  • Loading branch information
LZS911 authored Dec 3, 2024
2 parents cbe8a0b + 5b1f4ba commit 68c86bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/base/src/page/Nav/SideMenu/MenuList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const MenuList: React.FC<Props> = ({ projectID }) => {
return checkPagePermission(menu.permission);
}

if ((menu as SubMenuType).children) {
if ((menu as SubMenuType)?.children) {
(menu as SubMenuType).children = filterMenusByPermissions(
(menu as SubMenuType).children as CustomMenuItemType[]
);
Expand All @@ -46,7 +46,7 @@ const MenuList: React.FC<Props> = ({ projectID }) => {
(config: MenuProps['items'] = [], pathname: string): string[] => {
for (const route of config) {
if (!route) {
return [];
continue;
}
const realPath = `/${route?.key}`.replace(
SIDE_MENU_DATA_PLACEHOLDER_KEY,
Expand Down

0 comments on commit 68c86bb

Please sign in to comment.