This commit is contained in:
tiago.kayaya
2022-01-28 17:34:27 +01:00
parent 666a51e710
commit 202e09231b
4 changed files with 29 additions and 16 deletions
@@ -45,9 +45,15 @@ export class WsChatMethodsService {
const rooms = await this.WsChatService.getRooms();
// console.log("ROOMS" + JSON.stringify(rooms))
const sortedRoomList = this.sortService.sortDate(rooms.result.update, "_updatedAt.$date")
rooms.result.update.forEach((roomData: room) => {
console.log(rooms.result.update);
console.log(sortedRoomList);
//console.log("ROOMS" + JSON.stringify(rooms))
sortedRoomList.forEach((roomData: room) => {
this.prepareRoom(roomData);
});
@@ -106,7 +112,7 @@ export class WsChatMethodsService {
prepareRoom(roomData){
let room:RoomService;
room = new RoomService(this.WsChatService, new MessageService(this.storage), this.storage, this.platform, this.sqlservice, this.NativeNotificationService)
room = new RoomService(this.WsChatService, new MessageService(this.storage), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService)
room.setData({
customFields: roomData.customFields,
@@ -123,8 +129,6 @@ export class WsChatMethodsService {
let roomId = this.getRoomId(roomData)
if(this.isIndividual(roomData)) {
console.log(room);
this.dm[roomId] = room
this.dmCount++
} else {