From c615447a3b4a859746e770d2ae35869fe8cfd4ab Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 25 Oct 2021 12:56:21 -0500 Subject: [PATCH] Don't send msg to chatbox when scrolled back --- scripts/client/chatbox.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js index a014badc..37526c4b 100644 --- a/scripts/client/chatbox.js +++ b/scripts/client/chatbox.js @@ -46,9 +46,11 @@ function unBindChatBoxKeys() { // =========================================================================== function receiveChatBoxMessageFromServer(messageString, colour) { - message(messageString, colour); + if(bottomMessageIndex => chatBoxHistory.length-1) { + message(messageString, colour); + bottomMessageIndex = chatBoxHistory.length-1; + } addToChatBoxHistory(messageString, colour); - bottomMessageIndex = chatBoxHistory.length-1; } // ===========================================================================