Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -4,7 +4,9 @@ function update_chat_html (data,msg_cont) {
|
|||||||
if (msg_cont !== null){
|
if (msg_cont !== null){
|
||||||
if (msg_cont.dataset['curReceiver'] === ""){
|
if (msg_cont.dataset['curReceiver'] === ""){
|
||||||
document.querySelector(".fotter-chat")
|
document.querySelector(".fotter-chat")
|
||||||
msg_cont.innerHTML = data.chat_html
|
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
||||||
|
msg_cont.innerHTML = data.chat_html
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// что бы не выводился левый чат
|
// что бы не выводился левый чат
|
||||||
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
function sendMessageSocket (data) {
|
function sendMessageSocket (data) {
|
||||||
if (chatSocket.readyState !== 1 || chatSocket.readyState !== 0){
|
if (chatSocket.readyState !== 1 && chatSocket.readyState !== 0){
|
||||||
init_ws()
|
init_ws()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,9 @@ function wsReceiveData (e) {
|
|||||||
} else {
|
} else {
|
||||||
if (data.chat_html){
|
if (data.chat_html){
|
||||||
if (msg_cont){
|
if (msg_cont){
|
||||||
msg_cont.innerHTML = data.chat_html
|
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
||||||
|
msg_cont.innerHTML = data.chat_html
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let error_msg_cont = "msg_cont is not defined"
|
let error_msg_cont = "msg_cont is not defined"
|
||||||
console.log(error_msg_cont)
|
console.log(error_msg_cont)
|
||||||
@@ -78,7 +80,7 @@ function wsReceiveData (e) {
|
|||||||
} else if (data.support_chat_html){
|
} else if (data.support_chat_html){
|
||||||
let cont_mes_ins = document.querySelector(".info_profile")
|
let cont_mes_ins = document.querySelector(".info_profile")
|
||||||
if (cont_mes_ins){
|
if (cont_mes_ins){
|
||||||
cont_mes_ins.innerHTML = data.chat_html
|
cont_mes_ins.innerHTML = data.support_chat_html
|
||||||
} else {
|
} else {
|
||||||
let error_cont_mes_ins = "cont_mes_ins is not defined"
|
let error_cont_mes_ins = "cont_mes_ins is not defined"
|
||||||
console.log(error_cont_mes_ins)
|
console.log(error_cont_mes_ins)
|
||||||
|
|||||||
Reference in New Issue
Block a user