Can delete again messages

This commit is contained in:
Pierre HUBERT 2021-03-06 14:49:45 +01:00
parent 92a8c90c1f
commit ba2c21bf54
2 changed files with 4 additions and 4 deletions

View File

@ -206,7 +206,7 @@ class UserWebSocket {
break; break;
case "deleted_conv_message": case "deleted_conv_message":
SendEvent("deletedConvMessage", msg.data.ID); SendEvent("deletedConvMessage", msg.data.id);
break; break;
case "new_comment": case "new_comment":

View File

@ -656,7 +656,7 @@ const ConversationPageConvPart = {
}); });
//Scroll to newest message //Scroll to newest message
let el = document.querySelector("[data-chatpage-msg-text-id=\""+response[0].ID+"\"]") let el = document.querySelector("[data-chatpage-msg-text-id=\""+response[0].id+"\"]")
if(el) { if(el) {
el = el.parentNode el = el.parentNode
/** @type {HTMLDivElement} */ /** @type {HTMLDivElement} */
@ -710,9 +710,9 @@ document.addEventListener("updatedConvMessage", async (e) => {
document.addEventListener("deletedConvMessage", (e) => { document.addEventListener("deletedConvMessage", (e) => {
const msgID = e.detail; const msgID = e.detail;
const target = document.querySelector("[data-chatpage-msg-text-id='"+msgID+"']") const target = document.querySelector("[data-chatpage-msg-text-id='"+msgID+"']");
if(!target) if(!target)
return; return;
target.parentNode.remove() target.parentNode.remove()
}) })