From e5f91e6ab2e79a39a13d744f2f5b9eb53c193c71 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 6 Mar 2021 14:09:19 +0100 Subject: [PATCH] Handle the messages of people who left the conversation --- assets/js/components/conversations/chatWindows.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index dcfaf371..05d5d4c5 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -879,11 +879,22 @@ const ConvChatWindow = { //Load user informations let userInfo = conversationInfo.membersInfos.get(message.user_id); if(userInfo) { - //Replace poster name usernameElem.innerHTML = userInfo.fullName; userAccountImage.src = userInfo.image; } + else { + async () => { + try { + const userInfo = await userInfo(message.user_id); + usernameElem.innerHTML = userInfo.fullName; + userAccountImage.src = userInfo.image; + } catch(e) { + console.error(e); + } + } + } + //Add message var messageTargetElem = createElem2({ appendTo: messageContainer,