0.0.163
This commit is contained in:
@@ -79,7 +79,7 @@ function clear_messenger (data) {
|
||||
}
|
||||
}
|
||||
|
||||
function update_support_chat_func (data){
|
||||
function update_support_chat_func (data,msg_cont){
|
||||
if (msg_cont !== null){
|
||||
if (msg_cont.dataset['curReceiver'] === ""){
|
||||
document.querySelector(".info_profile").innerHTML = data.support_chat_html
|
||||
|
||||
@@ -42,27 +42,46 @@ chatSocket.onmessage = function (e) {
|
||||
update_tickets_operations_manager(el_tab,data,old_item_tab_user,null,'wo')
|
||||
|
||||
// if (){
|
||||
if (data.group_name === "support_managers"){
|
||||
let user_id = document.querySelector(".button_profile_header").dataset["userId"]
|
||||
if (user_id){
|
||||
if (data.ticket_manager !== user_id){
|
||||
clear_messenger()
|
||||
if (data.group_name === "support_managers") {
|
||||
let ticket_maneger = data.ticket_manager
|
||||
if (ticket_maneger) {
|
||||
let user_id = document.querySelector(".button_profile_header").dataset["userId"]
|
||||
if (user_id) {
|
||||
if (ticket_maneger.toString() !== user_id) {
|
||||
clear_messenger()
|
||||
}
|
||||
}
|
||||
else {
|
||||
let user_id_inf_er = "Error user id is not defined"
|
||||
console.log(user_id_inf_er)
|
||||
// не найден user id
|
||||
}
|
||||
} else {
|
||||
let user_id_inf_er = "Error user id is not defined"
|
||||
console.log(user_id_inf_er)
|
||||
// не найден user id
|
||||
let error_ticket_manager = "ticket_manager is not defined"
|
||||
console.log(error_ticket_manager)
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
let cont_mes_ins = document.querySelector(".info_profile")
|
||||
if (cont_mes_ins){
|
||||
cont_mes_ins.innerHTML = data.chat_html
|
||||
} else {
|
||||
let error_cont_mes_ins = "cont_mes_ins is not defined"
|
||||
console.log(error_cont_mes_ins)
|
||||
// не найден info profile
|
||||
if (data.chat_html){
|
||||
if (msg_cont){
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
} else {
|
||||
let error_msg_cont = "msg_cont is not defined"
|
||||
console.log(error_msg_cont)
|
||||
}
|
||||
} else if (data.support_chat_html){
|
||||
let cont_mes_ins = document.querySelector(".info_profile")
|
||||
if (cont_mes_ins){
|
||||
cont_mes_ins.innerHTML = data.chat_html
|
||||
} else {
|
||||
let error_cont_mes_ins = "cont_mes_ins is not defined"
|
||||
console.log(error_cont_mes_ins)
|
||||
// не найден info profile
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
// if
|
||||
@@ -71,7 +90,7 @@ chatSocket.onmessage = function (e) {
|
||||
|
||||
|
||||
} else if (data.type === "update_support_chat"){
|
||||
update_support_chat_func(data)
|
||||
update_support_chat_func(data,msg_cont)
|
||||
}
|
||||
if (data.unread_msgs_count > 0){
|
||||
update_count_unread_messages(data)
|
||||
|
||||
Reference in New Issue
Block a user