mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -718,24 +718,23 @@ export class RoomService {
|
|||||||
await this.restoreMessageFromDB()
|
await this.restoreMessageFromDB()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||||
// console.log('load history', chatHistory)
|
// console.log('load history', chatHistory)
|
||||||
//
|
//
|
||||||
|
|
||||||
const messagesId = this.messages.map((message)=> message._id)
|
const messagesId = this.messages.map((message)=> message._id)
|
||||||
|
|
||||||
await chatHistory.result.messages.reverse().forEach(async(message: any) => {
|
for(let message of chatHistory.result.messages.reverse()) {
|
||||||
|
|
||||||
if (!messagesId.includes(message._id)) {
|
if (!messagesId.includes(message._id)) {
|
||||||
const messagesToSave = await this.prepareMessageCreateIfNotExist_iD({message: message});
|
const messagesToSave = await this.prepareMessageCreateIfNotExist_iD({message: message});
|
||||||
if(messagesToSave) {
|
if(messagesToSave) {
|
||||||
messagesToSave.addMessageDB()
|
messagesToSave.addMessageDB()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user