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: #122
Co-authored-by: mummified-corroding-granny <mummified-corroding-granny@noreply.fsdfsd.net>
Co-committed-by: mummified-corroding-granny <mummified-corroding-granny@noreply.fsdfsd.net>
pull/123/head
mummified-corroding-granny 2023-02-16 13:41:43 +00:00 committed by Aevann
parent 211110baef
commit 0c670299c0
2 changed files with 2 additions and 1 deletions

View File

@ -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 = '<b>Users Online</b>'

View File

@ -157,7 +157,7 @@
<li class="nav-item d-none d-lg-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link position-relative" href="/chat">
<i class="fas fa-messages" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"></i>
<b class="text-lg" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">
<b id="chat-count-header-bar" class="text-lg" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">
{{loggedin_chat}}
</b>
</a>