ignore already received chat messages

This commit is contained in:
Felicio Mununga 2022-06-09 18:48:27 +02:00
parent 2d729a9b4e
commit 9e3e56888b
No known key found for this signature in database
GPG Key ID: 0EB8D75C775AB6F1
1 changed files with 8 additions and 8 deletions

View File

@ -223,11 +223,11 @@ export class Community {
while (messageIndex > 0) {
const _message = _messages[messageIndex - 1]
// if (_message.messageId === chatMessage.messageId) {
// messageIndex = -1
if (_message.messageId === chatMessage.messageId) {
messageIndex = -1
// break
// }
break
}
if (
new Date(Number(_message.timestamp)) <=
@ -239,10 +239,10 @@ export class Community {
messageIndex--
}
// // already received
// if (messageIndex < 0) {
// return
// }
// already received
if (messageIndex < 0) {
return
}
// replied
let responsedToMessageIndex = _messages.length