From d7ad94e151a7dacd646d61320a613fbc2c86a38c Mon Sep 17 00:00:00 2001 From: rnjshippo Date: Mon, 14 Dec 2020 16:12:57 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20thread=20=EB=91=90=EB=B2=88=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/ThreadListBox/ThreadListBox.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/components/ThreadListBox/ThreadListBox.tsx b/client/src/components/ThreadListBox/ThreadListBox.tsx index 19c63b76..d11fbe33 100644 --- a/client/src/components/ThreadListBox/ThreadListBox.tsx +++ b/client/src/components/ThreadListBox/ThreadListBox.tsx @@ -38,10 +38,15 @@ const ThreadListBox = () => { if (userInfo) { dispatch(loadChannelRequest({ channelId: +channelId, userId: userInfo.id })); } - dispatch(getThreadRequest({ channelId: Number(channelId) })); } }, [channelId, userInfo]); + useEffect(() => { + if (Number.isInteger(+channelId)) { + dispatch(getThreadRequest({ channelId: +channelId })); + } + }, [channelId]); + useEffect(() => { if (current && socket) { dispatch(enterRoomRequest({ room: current.name }));