From 3c3daf13cde577da8fd818c0fa7456de4ace1043 Mon Sep 17 00:00:00 2001 From: borissedw Date: Mon, 14 Aug 2023 21:35:13 +0300 Subject: [PATCH] 0.0.138 --- static/js/chat_sockets.js | 10 +++++++--- templates/blocks/profile/b_support_chat.html | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/static/js/chat_sockets.js b/static/js/chat_sockets.js index 40e4e5b..65cfcc3 100644 --- a/static/js/chat_sockets.js +++ b/static/js/chat_sockets.js @@ -50,7 +50,9 @@ const chatSocket = new WebSocket(url); function sendMessageSocket (data) { chatSocket.send(JSON.stringify(data)); let el_tab = document.querySelector(".tab_user_messanger.select") - el_tab.querySelector(".last-message-messenger-user-tab").innerHTML = data['text'] + if (el_tab !== null){ + el_tab.querySelector(".last-message-messenger-user-tab").innerHTML = data['text'] + } } @@ -103,8 +105,10 @@ chatSocket.onmessage = function (e) { } } } else if (data.type === "update_support_chat"){ - if (msg_cont.dataset['curReceiver'] === ""){ - document.querySelector(".info_profile").innerHTML = data.support_chat_html + if (msg_cont !== null){ + if (msg_cont.dataset['curReceiver'] === ""){ + document.querySelector(".info_profile").innerHTML = data.support_chat_html + } } } if (data.unread_msgs_count > 0){ diff --git a/templates/blocks/profile/b_support_chat.html b/templates/blocks/profile/b_support_chat.html index 1c84c09..a0eb19b 100644 --- a/templates/blocks/profile/b_support_chat.html +++ b/templates/blocks/profile/b_support_chat.html @@ -48,11 +48,11 @@