0.0.127
This commit is contained in:
@@ -61,7 +61,9 @@ chatSocket.onmessage = function (e) {
|
|||||||
} else if (data.type === "echo") {
|
} else if (data.type === "echo") {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
} else if (data.type === "update_chat") {
|
} else if (data.type === "update_chat") {
|
||||||
document.querySelector(".container-messages").innerHTML = data.chat_html
|
let msg_cont = document.querySelector(".container-messages")
|
||||||
|
if (msg_cont.dataset['curReceiver'] === data['sender'] || data['receiver']) {
|
||||||
|
msg_cont.innerHTML = data.chat_html
|
||||||
if (data.required_beep === true) {
|
if (data.required_beep === true) {
|
||||||
const beep = new Audio('/static/sounds/beep_2.mp3')
|
const beep = new Audio('/static/sounds/beep_2.mp3')
|
||||||
beep.play()
|
beep.play()
|
||||||
@@ -69,6 +71,7 @@ chatSocket.onmessage = function (e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// let url = `ws://localhost:8000/ws/socket-server/`;
|
// let url = `ws://localhost:8000/ws/socket-server/`;
|
||||||
|
|||||||
Reference in New Issue
Block a user