mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 04:09:20 +00:00
Handle conversation deleted event
This commit is contained in:
parent
0a5a2637f5
commit
54d8245f91
@ -217,6 +217,10 @@ class UserWebSocket {
|
||||
SendEvent("removedUserFromConv", msg.data);
|
||||
break;
|
||||
|
||||
case "deleted_conversation":
|
||||
SendEvent("deletedConversation", msg.data);
|
||||
break;
|
||||
|
||||
case "new_comment":
|
||||
SendEvent("new_comment", msg.data);
|
||||
break;
|
||||
|
@ -1506,3 +1506,12 @@ document.addEventListener("removedUserFromConv", e => {
|
||||
|
||||
ConvChatWindow.__conversationsCache["conversation-"+msg.conv_id].box.closeFunction();
|
||||
});
|
||||
|
||||
document.addEventListener("deletedConversation", e => {
|
||||
const convID = e.detail;
|
||||
|
||||
if(!ConvService.__serviceCache.hasOwnProperty("conversation-" + convID))
|
||||
return;
|
||||
|
||||
ConvChatWindow.__conversationsCache["conversation-"+convID].box.closeFunction();
|
||||
});
|
@ -696,6 +696,13 @@ document.addEventListener("deletedConvMessage", (e) => {
|
||||
document.addEventListener("removedUserFromConv", e => {
|
||||
const msg = e.detail;
|
||||
|
||||
if (msg.user_id == userID() && ConversationPageConvPart._conv_info.id)
|
||||
if (msg.user_id == userID() && ConversationPageConvPart._conv_info.id == msg.conv_id)
|
||||
Page.openPage("conversations");
|
||||
});
|
||||
|
||||
document.addEventListener("deletedConversation", e => {
|
||||
const convID = e.detail;
|
||||
|
||||
if (ConversationPageConvPart._conv_info.id == convID)
|
||||
Page.openPage("conversations");
|
||||
});
|
Loading…
Reference in New Issue
Block a user