mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Improve load history
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user