From e995bb0fde79a87416468610722befcb65159b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B4=91=EB=AF=BC?= Date: Mon, 4 Aug 2025 03:33:52 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0=EB=9D=BC=20api=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useNotification.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hooks/useNotification.ts b/src/hooks/useNotification.ts index bd03aff0..73e9f563 100644 --- a/src/hooks/useNotification.ts +++ b/src/hooks/useNotification.ts @@ -43,13 +43,17 @@ export const getMyNotifications = async ( * @example * const { data, isLoading } = useNotifications({ size: 10 }); */ -export const useNotifications = (params: NotificationParams) => { +export const useNotifications = ( + params: NotificationParams, + isEnabled: boolean = true, +) => { return useQuery({ queryKey: ['notifications', params], queryFn: async () => { const data = await getMyNotifications(params); return data || { notifications: [], totalCount: 0 }; }, - refetchInterval: 10000, + refetchInterval: isEnabled ? 10000 : false, + enabled: isEnabled, }); }; From 6b80475721d800ed11cb93be2267ef8546c02dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B4=91=EB=AF=BC?= Date: Mon, 4 Aug 2025 03:34:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=95=8C=EB=9E=8C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=83=81=ED=83=9C=20=EB=84=A3=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index b95c6ae5..ec908af9 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -21,7 +21,7 @@ export default function Header() { const toggleOpen = () => setIsOpen((prev) => !prev); - const { data } = useNotifications({ size: 10 }); + const { data } = useNotifications({ size: 10 }, isLoggedIn); const hasNotification = (data?.totalCount ?? 0) > 0; const handleLogoClick = () => {