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