Skip to content

Commit da0a3f8

Browse files
committed
feat : 리뷰 사항 반영
1 parent 08969a5 commit da0a3f8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/components/common/header/Header.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ function Header() {
4242
: DefaultImg;
4343

4444
useEffect(() => {
45-
testLiveAlarm();
45+
if (process.env.NODE_ENV === 'deployment') {
46+
testLiveAlarm();
47+
}
4648
}, []);
4749

4850
return (

src/hooks/user/useNotification.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ const useNotification = () => {
6363
console.error(e);
6464
};
6565
}
66-
}, [queryClient, userId]);
66+
67+
return () => {
68+
if (eventSourceRef.current) {
69+
eventSourceRef.current.close();
70+
eventSourceRef.current = null;
71+
}
72+
};
73+
}, [queryClient, userId, accessToken]);
6774
};
6875

6976
export default useNotification;

0 commit comments

Comments
 (0)