From d29722338d6792c27d538d75f20b0e01c582b3be Mon Sep 17 00:00:00 2001 From: EunBae Gong Date: Wed, 31 Jan 2024 16:24:13 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=B1=20=EB=A1=9C=EB=94=A9=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=EC=97=90=20=EB=8D=B0=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=EB=A5=BC=20=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainContainer/MainContainer.tsx | 5 +--- src/hooks/useInitApp.ts | 24 +++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/components/containers/MainContainer/MainContainer.tsx b/src/components/containers/MainContainer/MainContainer.tsx index 73464ed..c6b7342 100644 --- a/src/components/containers/MainContainer/MainContainer.tsx +++ b/src/components/containers/MainContainer/MainContainer.tsx @@ -2,16 +2,13 @@ import { useCallback } from 'react'; import MainPage from '../../pages/MainPage'; import TimelineView from '../../templates/TimelineView'; import useIsMainStore from '../../../store/isMain'; -import APIService from '../../../api'; const MainContainer = () => { const { isMain, setTimelinePage } = useIsMainStore(); - const setTimelineView = useCallback(async () => { + const setTimelineView = useCallback(() => { setTimelinePage(); // eslint-disable-next-line react-hooks/exhaustive-deps - const recapInfo = await APIService.getLibraryHistories(); - console.log(recapInfo); }, []); return isMain ? ( diff --git a/src/hooks/useInitApp.ts b/src/hooks/useInitApp.ts index 41cdefc..8000c17 100644 --- a/src/hooks/useInitApp.ts +++ b/src/hooks/useInitApp.ts @@ -1,12 +1,12 @@ import { useEffect } from 'react'; import uoslifeBridge from '../bridge'; import useUserStore from '../store/user'; -// import APIService from '../api/service'; -// import useRecapInfoStore from '../store/recapInfo'; +import APIService from '../api/service'; +import useRecapInfoStore from '../store/recapInfo'; const useInitApp = () => { const { setUser, setDefaultUser } = useUserStore(); - // const { setRecapInfo } = useRecapInfoStore(); + const { setRecapInfo } = useRecapInfoStore(); const handleUserInfo = async () => { try { @@ -16,19 +16,19 @@ const useInitApp = () => { setDefaultUser(); } }; - // const handleRecapInfo = async () => { - // try { - // const recapInfo = await APIService.getLibraryHistories(); - // setRecapInfo(recapInfo); - // } catch (e) { - // console.error(e); - // } - // }; + const handleRecapInfo = async () => { + try { + const recapInfo = await APIService.getLibraryHistories(); + setRecapInfo(recapInfo); + } catch (e) { + console.error(e); + } + }; useEffect(() => { (async () => { handleUserInfo(); - // handleRecapInfo(); + handleRecapInfo(); })(); }, []); };