Skip to content

Commit

Permalink
[fix](Nav): Fix menu children errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zzyangh committed Dec 3, 2024
1 parent e0f6970 commit 5b1f4ba
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) {

Check warning on line 32 in packages/base/src/page/Nav/SideMenu/MenuList/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 32 in packages/base/src/page/Nav/SideMenu/MenuList/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
(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;

Check warning on line 49 in packages/base/src/page/Nav/SideMenu/MenuList/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 49 in packages/base/src/page/Nav/SideMenu/MenuList/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 50 in packages/base/src/page/Nav/SideMenu/MenuList/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const realPath = `/${route?.key}`.replace(
SIDE_MENU_DATA_PLACEHOLDER_KEY,
Expand Down

0 comments on commit 5b1f4ba

Please sign in to comment.