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 }));