chore: bypass 404 page

This commit is contained in:
ValdiANS
2026-02-03 12:03:24 +07:00
parent 4fef966428
commit 2d13564538
+7 -1
View File
@@ -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 <PermissionNotFound />;
}
if (isPathnameNotFoundPage) {
return children;
}
return (
<Drawer
open={mainDrawerOpen}