diff --git a/src/components/MainDrawer.tsx b/src/components/MainDrawer.tsx index fdb65c38..71da0789 100644 --- a/src/components/MainDrawer.tsx +++ b/src/components/MainDrawer.tsx @@ -74,6 +74,8 @@ const MainDrawer = ({ const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`; + const isPathnameNotFoundPage = formattedPathname === '/404/'; + const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) => permissionCheck(permission) ); @@ -82,10 +84,14 @@ const MainDrawer = ({ setMainDrawerOpen(!mainDrawerOpen); }; - if (!isPermitted) { + if (!isPermitted && !isPathnameNotFoundPage) { return ; } + if (isPathnameNotFoundPage) { + return children; + } + return (