chore: getCurrentMenu 수정
This commit is contained in:
@@ -5,7 +5,11 @@ export const getCurrentMenu = (
|
||||
pathname: string,
|
||||
): MenuItem | null => {
|
||||
for (const menu of menus) {
|
||||
if (menu.urlPath === pathname) return menu;
|
||||
if (
|
||||
menu.urlPath !== "" &&
|
||||
(menu.urlPath === pathname || pathname.startsWith(menu.urlPath))
|
||||
)
|
||||
return menu;
|
||||
|
||||
if (menu.children) {
|
||||
const children = getCurrentMenu(menu.children, pathname);
|
||||
|
||||
Reference in New Issue
Block a user