From 3833e46ba8871f85cf1cb7120e313b19995258ab Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 3 Apr 2020 09:09:17 +0200 Subject: [PATCH] Propagate message deletion to conversations page --- assets/js/pages/conversations/conversation.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assets/js/pages/conversations/conversation.js b/assets/js/pages/conversations/conversation.js index 263cf20e..30483a65 100644 --- a/assets/js/pages/conversations/conversation.js +++ b/assets/js/pages/conversations/conversation.js @@ -621,4 +621,15 @@ document.addEventListener("updatedConvMessage", (e) => { }); target.replaceWith(newMessageContent) +}) + +// Register to conversation message deletion event +document.addEventListener("deletedConvMessage", (e) => { + const msgID = e.detail; + + const target = document.querySelector("[data-chatpage-msg-text-id='"+msgID+"']") + if(!target) + return; + + target.parentNode.remove() }) \ No newline at end of file