From 37e2f1d3f21c57c6a954200cad415e2c0a8e4d5c Mon Sep 17 00:00:00 2001 From: ktyl Date: Wed, 10 Jul 2024 14:16:33 +0100 Subject: [PATCH] feat: scroll down on new messages --- main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.js b/main.js index e9b349a..e6d9264 100644 --- a/main.js +++ b/main.js @@ -114,6 +114,9 @@ function addMessage(idx) { let message = conversation[idx]; let messageHtml = getMessageHtml(message.text, isMessageOurs(message)); getMessageList().innerHTML += messageHtml; + + // scroll as far as we can so that messages aren't hidden + window.scrollTo(0, document.body.scrollHeight); } function getMessageHtml(text, isOurs) {