From 89a43973483ab0dff25b80cad2669ac35ed621e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A0=95=EC=9A=B0?= Date: Thu, 22 Feb 2024 19:44:31 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EC=96=B8=EB=A7=88=EC=9A=B4=ED=8A=B8=EC=8B=9C=20SSE=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20close=20(#28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 홈 화면 날짜 getDay() -> getDate()로 수정 * feat: Drive 컴포넌트 언마운트시 event close * feat: console.log 추가 --- src/components/Drive/index.tsx | 4 ++++ src/components/Home/index.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Drive/index.tsx b/src/components/Drive/index.tsx index b6acb5a..95f1c79 100644 --- a/src/components/Drive/index.tsx +++ b/src/components/Drive/index.tsx @@ -44,6 +44,10 @@ export const Drive = () => { useEffect(() => { fetchSSE(); + return () => { + console.log("sse close"); + eventSource.close(); + }; }, []); return ( diff --git a/src/components/Home/index.tsx b/src/components/Home/index.tsx index 896ac7a..6d9ec9e 100644 --- a/src/components/Home/index.tsx +++ b/src/components/Home/index.tsx @@ -24,7 +24,7 @@ export const Home = () => { 김모비님, 안녕하세요! {`${date.getFullYear()}년 ${ date.getMonth() + 1 - }월 ${date.getDay()}일 (${getDayName(date)})`} + }월 ${date.getDate()}일 (${getDayName(date)})`}