diff --git a/templates/chat.html b/templates/chat.html index b324200..c1fc80b 100644 --- a/templates/chat.html +++ b/templates/chat.html @@ -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