This commit is contained in:
Peter Maquiran
2023-02-06 18:48:50 +01:00
parent 2d0f23749c
commit 43634e86ec
4 changed files with 22 additions and 24 deletions
+9 -3
View File
@@ -172,9 +172,13 @@ export class RoomService {
this.members = members
this.membersExcludeMe = membersExcludeMe
this.calDateDuration()
this.restoreMessageFromDB()
this.calDateDuration();
(async () => {
await this.restoreMessageFromDB()
await this.loadHistory({})
})()
if(this.customFields?.countDownDate) {
this.countDownDate(this.customFields.countDownDate);
}
@@ -746,6 +750,8 @@ export class RoomService {
}
}
this.hasLoadHistory = true
const chatHistory: chatHistory = await this.RochetChatConnectorService.loadHistory(this.id, limit)
if(chatHistory?.result?.messages) {
@@ -756,6 +762,7 @@ export class RoomService {
for(let message of chatHistory.result.messages.reverse()) {
if (!messagesId.includes(message._id)) {
message.origin = 'history'
message.from = 'History'
const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message});
if(messagesToSave != null) {
@@ -776,7 +783,6 @@ export class RoomService {
this.scrollDown()
}, 50)
this.hasLoadHistory = true
}
}