From 50d499005d988f898ccbdc7771bce4ac1811fc1d Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Wed, 7 Jan 2026 13:57:00 +0700 Subject: [PATCH] fix: format pathname --- src/components/MainDrawer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/MainDrawer.tsx b/src/components/MainDrawer.tsx index fc8cbb18..eaf1e2c1 100644 --- a/src/components/MainDrawer.tsx +++ b/src/components/MainDrawer.tsx @@ -67,7 +67,9 @@ const MainDrawer = ({ const pathname = usePathname(); const { permissionCheck } = useAuth(); - const isPermitted = ROUTE_PERMISSIONS[pathname]?.some((permission) => + const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`; + + const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) => permissionCheck(permission) );