diff --git a/src/api/useGetNotificationPresent.ts b/src/api/useGetNotificationPresent.ts index 6ec218d..bba1ce9 100644 --- a/src/api/useGetNotificationPresent.ts +++ b/src/api/useGetNotificationPresent.ts @@ -1,11 +1,13 @@ import { useQuery } from '@tanstack/react-query'; import { request } from './config'; +import { getAccessToken } from '@/components/login/Auth/token'; interface NotificationPresentResponse { present: boolean; } export function useGetNotificationPresent() { + const accessToken = getAccessToken(); return useQuery({ queryKey: ['notificationPresent'], queryFn: () => @@ -13,5 +15,6 @@ export function useGetNotificationPresent() { method: 'GET', url: '/notifications/present', }), + enabled: !!accessToken, }); }