This commit is contained in:
tiago.kayaya
2022-01-28 19:04:46 +01:00
5 changed files with 50 additions and 9 deletions
+9 -4
View File
@@ -66,7 +66,7 @@ export class RoomService {
receiveMessage() {
this.WsChatService.upateRoomEvents(
this.WsChatService.updateRoomEventss(
this.id,
"stream-room-messages",
(ChatMessage) => {
@@ -128,7 +128,7 @@ export class RoomService {
async receiveMessageDelete() {
this.WsChatService.upateRoomEvents(
this.WsChatService.updateRoomEventss(
this.id,
"stream-notify-room",
async (ChatMessage) => {
@@ -194,7 +194,7 @@ export class RoomService {
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping)
}
} else {
console.log(now - this.lastTimeType)
//console.log(now - this.lastTimeType)
}
}, 3000)
@@ -282,12 +282,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) => {