From 45b2f886f55c254a3f831b57addffaad2793d525 Mon Sep 17 00:00:00 2001 From: CHOI GIHOAWN Date: Thu, 3 Oct 2024 14:00:09 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9B=B9,=20RN=20=EC=97=90=EC=84=9C?= =?UTF-8?q?=EC=9D=98=20=ED=91=B8=EC=8B=9C=20=EC=95=8C=EB=A6=BC=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=20=EB=B6=84=EA=B8=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Main.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/Main.tsx b/src/pages/Main.tsx index b71eb00..ff95af0 100644 --- a/src/pages/Main.tsx +++ b/src/pages/Main.tsx @@ -13,13 +13,14 @@ import { useToken } from '@/hooks/useToken.ts'; import { SECOND } from '@/constants/day.ts'; import { useQueryClient } from '@tanstack/react-query'; import { keyStore } from '@/queries/keyStore.ts'; +import { useNotification } from '@/hooks/useNotification.tsx'; const Main = () => { const { data: homeData } = useGetHomeData(); const { mutate: refreshAccessToken } = useRefreshAccessToken(); const { getRefreshToken, isValidToken, setRefreshToken, setAccessToken, getAccessToken } = useToken(); - // const { RequestPermissionModal, isPermissionChecked, openPermissionModal } = useNotification(); + const { RequestPermissionModal, isPermissionChecked, openPermissionModal } = useNotification(); const queryClient = useQueryClient(); @@ -45,10 +46,13 @@ const Main = () => { }, []); useEffect(() => { - // if (!isPermissionChecked) { - // openPermissionModal(); - // } - window.ReactNativeWebView.postMessage(getAccessToken()); + if (window.ReactNativeWebView) { + window?.ReactNativeWebView?.postMessage?.(getAccessToken()); + } else { + if (!isPermissionChecked) { + openPermissionModal(); + } + } }, []); useEffect(() => { @@ -67,7 +71,7 @@ const Main = () => { - {/**/} + ); };