fix issue with new chat session opened
This commit is contained in:
parent
e3f66da499
commit
d9592aba04
@ -124,13 +124,14 @@ class MessageList extends Component {
|
||||
// console.log('hasNewUnreadMessages=' + hasNewUnreadMessages);
|
||||
|
||||
// check if the messages include <user has left the meeting>
|
||||
const lastMessageId = nextProps.messages[nextProps.messages.length - 1].id;
|
||||
const userLeftIsDisplayed = lastMessageId.includes('partner-disconnected');
|
||||
const lastMessage = nextProps.messages[nextProps.messages.length - 1];
|
||||
if (lastMessage) {
|
||||
const userLeftIsDisplayed = lastMessage.id.includes('partner-disconnected');
|
||||
if (partnerIsLoggedOut && userLeftIsDisplayed) return false; // update leads to endless loop
|
||||
}
|
||||
|
||||
if (switchingCorrespondent || hasNewUnreadMessages) return true;
|
||||
|
||||
if (partnerIsLoggedOut && userLeftIsDisplayed) return false; // update leads to endless loop
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user