Skip to content

Commit

Permalink
🚨fix : 헤더 알람 비로그인시 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeon-hub authored Sep 25, 2023
2 parents 9e16323 + d351746 commit 634a333
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/layout/components/AlertButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ const AlertButton = () => {

const location = useLocation();
const { pathname } = location;
const { token } = userSessionData;
const { token, _id } = userSessionData;

const query = useQuery({
queryKey: ['headerAlert'],
queryFn: async () => {
const data = await getNotifications(`Bearer ${token}`);
return data;
},
enabled: token !== '' && _id !== '',
refetchInterval: () => (pathname === '/notice' ? false : 5000),
refetchIntervalInBackground: true
});
Expand Down

0 comments on commit 634a333

Please sign in to comment.