From ba2c21bf545053e5dd40c46d0a7498b9daa60d1d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 6 Mar 2021 14:49:45 +0100 Subject: [PATCH] Can delete again messages --- assets/js/common/ws.js | 2 +- assets/js/pages/conversations/conversation.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/common/ws.js b/assets/js/common/ws.js index 233afe7c..3b32a904 100644 --- a/assets/js/common/ws.js +++ b/assets/js/common/ws.js @@ -206,7 +206,7 @@ class UserWebSocket { break; case "deleted_conv_message": - SendEvent("deletedConvMessage", msg.data.ID); + SendEvent("deletedConvMessage", msg.data.id); break; case "new_comment": diff --git a/assets/js/pages/conversations/conversation.js b/assets/js/pages/conversations/conversation.js index f8ac6d01..7dd3cf94 100644 --- a/assets/js/pages/conversations/conversation.js +++ b/assets/js/pages/conversations/conversation.js @@ -656,7 +656,7 @@ const ConversationPageConvPart = { }); //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) { el = el.parentNode /** @type {HTMLDivElement} */ @@ -710,9 +710,9 @@ document.addEventListener("updatedConvMessage", async (e) => { document.addEventListener("deletedConvMessage", (e) => { 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) return; - + target.parentNode.remove() }) \ No newline at end of file