From 2d13564538a8ba7100b4275703f377eee6cc7f8d Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Tue, 3 Feb 2026 12:03:24 +0700 Subject: [PATCH] chore: bypass 404 page --- src/components/MainDrawer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 (