From cce42995b9f3cb38ed1c82cd9d302d8d739dd26e Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 18 May 2022 12:51:29 -0500 Subject: [PATCH] Fix previous bug --- templates/chat/chat.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/chat/chat.html b/templates/chat/chat.html index 9897d71..3a1d631 100644 --- a/templates/chat/chat.html +++ b/templates/chat/chat.html @@ -98,7 +98,7 @@ let META_HEADER = [ })} window.load_dynamic_update = function (last_msg) { - var receiver = EventReceiver( + var receiver = new EventReceiver( "{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}", ['chat_lobby', 'chat_{{request.profile.id}}'], last_msg, function (message) { var room = (message.type == 'lobby') ? '' : message.room; @@ -208,9 +208,12 @@ let META_HEADER = [ if ($('#message-'+tmp_id).length) { $('#message-'+tmp_id).replaceWith(data); } - else { + else if ($('#body-block-'+tmp_id).length) { $('#body-block-'+tmp_id).replaceWith($body_block); } + else { + add_new_message(message, room); + } resize_emoji($body_block); MathJax.Hub.Queue(["Typeset",MathJax.Hub]); register_time($('.time-with-rel'));