Redirect user when he is removed from conversation

This commit is contained in:
Pierre HUBERT 2021-03-07 19:44:51 +01:00
parent 865a123897
commit ce0397d5be
2 changed files with 13 additions and 1 deletions

View File

@ -209,6 +209,10 @@ class UserWebSocket {
SendEvent("deletedConvMessage", msg.data.id);
break;
case "removed_user_from_conv":
SendEvent("removedUserFromConv", msg.data);
break;
case "new_comment":
SendEvent("new_comment", msg.data);
break;

View File

@ -685,4 +685,12 @@ document.addEventListener("deletedConvMessage", (e) => {
return;
target.parentNode.remove()
})
})
// Register to conversation removal
document.addEventListener("removedUserFromConv", e => {
const msg = e.detail;
if (msg.user_id == userID() && ConversationPageConvPart._conv_info.id)
Page.openPage("conversations");
});