fixed bug

This commit is contained in:
AmirHossein Mahmoodi
2025-01-19 13:17:39 +03:30
parent 9a8e082051
commit d072c5a695
2 changed files with 6 additions and 2 deletions

View File

@@ -15,7 +15,9 @@ const SidebarListItems = ({ menuItem, dispatch }) => {
component={menuItem.type === "page" ? Link : null}
href={menuItem.type === "page" ? menuItem.route : null}
onClick={() => {
dispatch({ type: "COLLAPSE_MENU", id: menuItem.id });
if (menuItem.type !== "page") {
dispatch({ type: "COLLAPSE_MENU", id: menuItem.id });
}
}}
>
<ListItemIcon

View File

@@ -14,7 +14,9 @@ const SidebarSubitems = ({ subitem, dispatch }) => {
component={subitem.type === "page" ? Link : null}
href={subitem.type === "page" ? subitem.route : null}
onClick={() => {
dispatch({ type: "COLLAPSE_SUB_ITEMS", id: subitem.id });
if (subitem.type !== "page") {
dispatch({ type: "COLLAPSE_SUB_ITEMS", id: subitem.id });
}
}}
>
<ListItemIcon