From fad19050784498f466098bf54d9bdb2f6409c027 Mon Sep 17 00:00:00 2001 From: shinmj Date: Fri, 29 Oct 2021 17:39:33 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20404=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EB=9D=BC=EC=9A=B0=ED=8C=85=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/portal/src/components/App/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/portal/src/components/App/index.tsx b/frontend/portal/src/components/App/index.tsx index 570da3d..9c2171b 100644 --- a/frontend/portal/src/components/App/index.tsx +++ b/frontend/portal/src/components/App/index.tsx @@ -95,7 +95,7 @@ const App = ({ component: Component, ...pageProps }: AppProps) => { ) useEffect(() => { - if (mounted && flatMenus) { + if (mounted && data?.length > 0 && flatMenus?.length > 0) { let path = router.asPath.indexOf('?') === -1 ? router.asPath @@ -110,7 +110,7 @@ const App = ({ component: Component, ...pageProps }: AppProps) => { } // 권한 없는 페이지 대해 호출이 있으면 404로 redirect - if (!authPage && flatMenus.length > 0 && !current) { + if (!authPage && !current) { if (!PUBLIC_PAGES.includes(router.asPath)) { router.push('/404') } @@ -118,7 +118,7 @@ const App = ({ component: Component, ...pageProps }: AppProps) => { setCurrentMenus(current) } - }, [router, mounted, flatMenus]) + }, [router, mounted, flatMenus, data]) if (loading) { return @@ -128,6 +128,10 @@ const App = ({ component: Component, ...pageProps }: AppProps) => { return null } + if (data?.length <= 0 || flatMenus?.length <= 0) { + return + } + return errorPage || naverLoginCallbackPage ? (