don't scroll when users join.

modified:   templates/chat.html
This commit is contained in:
Russell Ballestrini 2023-12-15 10:33:56 -05:00
parent 2b7999a857
commit 9c3bbe169f

View file

@ -308,7 +308,9 @@ socket.on("message", (data) => {
});
// Scroll to the bottom of the chat container
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight;
if (data.id) {
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight;
}
});
// Socket event for receiving previous messages
@ -355,6 +357,10 @@ socket.on("previous_messages", (data) => {
hljs.highlightElement(block);
addLineNumbers(block);
});
// Scroll to the bottom of the chat container
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight;
});
// Socket event for deleting a processing message