diff --git a/src/components/Chat.jsx b/src/components/Chat.jsx index ac6650d..8c52126 100644 --- a/src/components/Chat.jsx +++ b/src/components/Chat.jsx @@ -18,15 +18,17 @@ const Chat = ({ chatMessages, chatChannel }) => { initialScroll: Infinity, }); + const channelMessages = chatMessages[chatChannel]; + useLayoutEffect(() => { stayScrolled(); - }, [chatMessages.length]); + }, [channelMessages.length]); return (
{(message[0] === 'info') ? {message[1]} diff --git a/src/components/ChatInput.jsx b/src/components/ChatInput.jsx index 7fe9b63..3716820 100644 --- a/src/components/ChatInput.jsx +++ b/src/components/ChatInput.jsx @@ -47,22 +47,32 @@ class ChatInput extends React.Component { if (name) { return (