diff --git a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js index 33e043b..06e7501 100644 --- a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js +++ b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js @@ -15,6 +15,10 @@ function update_count_unread_messages(data) { list_unrd_parent[i].classList.toggle("showed"); } } + } else if(data.unanswered_msgs_count){ + for (let i = 0; i < list_unrd.length; i++){ + list_unrd[i].innerHTML = data.unanswered_msgs_count.toString() + } } else { for (let i = 0; i < list_unrd.length; i++) { let current_count = parseInt(list_unrd[i].innerHTML); diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index 784dc48..848c474 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -561,7 +561,7 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ } let user_type = getInfoAboutUser() - update_count_unread_messages() + // if (user_type === 'mobile' || user_type === 'laptop') { // open_curtain_w_contacts() // } @@ -592,6 +592,9 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ let top = document.querySelector(".tab_user_messanger.select").offsetTop document.querySelector(".menu_buttons.curtain.left.open").scrollTo({top:top}) } + + update_count_unread_messages(data); + // second time beacause we need to close curtain // if (user_type === 'mobile' || user_type === 'laptop') { // open_curtain_w_contacts()