diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 868443e7c..64e2aab06 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -48,7 +48,7 @@ export class RoomService { private platform: Platform, private sqlservice: SqliteService, private NativeNotificationService: NativeNotificationService, - ) { + ) { this.NativeNotificationService.askForPermission() } @@ -281,12 +281,17 @@ export class RoomService { if (this.hasLoadHistory) { return false } this.storage.get('chatmsg' + this.id).then((messages = [])=>{ + + let localMessages = [] + messages.forEach(message => { message = this.fix_updatedAt(message) const wewMessage = new MessageService(this.storage) wewMessage.setData(message) - this.messages.push(wewMessage) + localMessages.push(wewMessage) }); + + this.messages = localMessages }) this.WsChatService.loadHistory(this.id, limit).then((chatHistory:chatHistory) => {