Improve load history

This commit is contained in:
Peter Maquiran
2022-10-05 10:49:17 +01:00
parent a1f8d7461c
commit 9af0ed4d0d
+10 -11
View File
@@ -745,12 +745,9 @@ export class RoomService {
}
const chatHistory: chatHistory = await this.RochetChatConnectorService.loadHistory(this.id, limit)
await this.RochetChatConnectorService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
// console.log('load history', chatHistory)
//
if(chatHistory?.result?.messages) {
const messagesId = this.messages.map((message)=> message._id)
for(let message of chatHistory.result.messages.reverse()) {
@@ -761,14 +758,16 @@ export class RoomService {
}
}
}
})
setTimeout(() => {
this.scrollDown()
}, 50)
this.hasLoadHistory = true
this.messageReorder();
setTimeout(() => {
this.scrollDown()
}, 50)
this.hasLoadHistory = true
this.messageReorder();
}
}
async messageReorder() {