diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 2decbaab..a76be814 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -1485,4 +1485,18 @@ document.addEventListener("deletedConvMessage", (e) => { return; target.style.display = "none"; -}) \ No newline at end of file +}) + + +// Register to conversation removal +document.addEventListener("removedUserFromConv", e => { + const msg = e.detail; + + if (msg.user_id != userID()) + return; + + if(!ConvService.__serviceCache.hasOwnProperty("conversation-" + msg.conv_id)) + return; + + ConvChatWindow.__conversationsCache["conversation-"+msg.conv_id].box.closeFunction(); +}); \ No newline at end of file