This commit is contained in:
Eudes Inácio
2022-02-09 15:27:35 +01:00
2 changed files with 16 additions and 7 deletions
+12 -3
View File
@@ -103,7 +103,6 @@ export class RoomService {
}) })
if(!messageIsFound) { if(!messageIsFound) {
console.log('messageIsFound', messageIsFound)
const message = this.prepareMessage(ChatMessage) const message = this.prepareMessage(ChatMessage)
this.lastMessage = message this.lastMessage = message
@@ -119,9 +118,11 @@ export class RoomService {
title: this.name title: this.name
}); });
if(this.isSenderIsNotMe(ChatMessage)) {
this.addMessageDB(ChatMessage) this.addMessageDB(ChatMessage)
} else { }
console.log('have')
} }
}, 150) }, 150)
@@ -360,8 +361,16 @@ export class RoomService {
await chatHistory.result.messages.reverse().forEach( async (message) => { await chatHistory.result.messages.reverse().forEach( async (message) => {
this.prepareMessage(message) this.prepareMessage(message)
const wewMessage = this.prepareMessage(message, false)
if(wewMessage.offline == false) {
this.prepareMessage(message)
}
}); });
this.storage.set('chatmsg' + this.id, chatHistory)
}) })
setTimeout(() => { setTimeout(() => {