Merge branch 'feature/websocket' of bitbucket.org:equilibriumito/gabinete-digital into feature/websocket

This commit is contained in:
Peter Maquiran
2022-01-14 10:38:29 +01:00
14 changed files with 51 additions and 80 deletions
@@ -36,7 +36,7 @@ export class WsChatMethodsService {
this.loadingWholeList = true
const rooms = await this.WsChatService.getRooms();
// console.log("ROOMS" + JSON.stringify(rooms))
rooms.result.update.forEach((roomData: room) => {
@@ -47,10 +47,11 @@ export class WsChatMethodsService {
room = new RoomService(this.WsChatService, new MessageService())
room.setData({
customFields: roomData.customFields,
id: this.getRoomId(roomData),
name: this.getRoomName(roomData),
lastMessage: this.getRoomLastMessage(roomData),
_updatedAt: roomData._updatedAt['$date']
_updatedAt: new Date(roomData._updatedAt['$date'])
})
room.receiveMessage()
@@ -65,10 +66,10 @@ export class WsChatMethodsService {
this.groupCount++
}
});
console.log('this.group', this.group)
this.loadingWholeList = false
}
@@ -87,12 +88,16 @@ export class WsChatMethodsService {
}
}
getRoom(id): RoomService {
getDmRoom(id): RoomService {
try {
return this.dm[id]
} catch(e) {
} catch(e) {}
}
getGroupRoom(id): RoomService {
try {
return this.group[id]
}
} catch(e) {}
}
getRoomName(roomData: room) {