From 0c670299c0c7cabd68c790bb58cf4c81edb28f1f Mon Sep 17 00:00:00 2001 From: mummified-corroding-granny Date: Thu, 16 Feb 2023 13:41:43 +0000 Subject: [PATCH] chat: update header chat count on websocket update message (#122) Kindly, Just a small lil PR to make sure the chat counts keep synchronized in /chat as users come and go Thanks, granny Reviewed-on: https://fsdfsd.net/rDrama/rDrama/pulls/122 Co-authored-by: mummified-corroding-granny Co-committed-by: mummified-corroding-granny --- files/assets/js/chat.js | 1 + files/templates/header.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index 3661de299..47cfc432d 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -196,6 +196,7 @@ textbox.addEventListener("keyup", function(e) { socket.on('online', function(data){ document.getElementsByClassName('board-chat-count')[0].innerHTML = data[0].length + document.getElementById('chat-count-header-bar').innerHTML = data[0].length const admin_level = parseInt(document.getElementById('admin_level').value) let online = '' let online2 = 'Users Online' diff --git a/files/templates/header.html b/files/templates/header.html index d6d17b01c..aac24eca4 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -157,7 +157,7 @@