This commit is contained in:
Peter Maquiran
2022-01-29 17:07:18 +01:00
5 changed files with 21 additions and 18 deletions
@@ -63,8 +63,8 @@ export class WsChatMethodsService {
}, 100)
}
}
}
if(message.msg =='changed' && message.collection == "stream-notify-room") {
if(message.fields.eventName.includes('deleteMessage')){
@@ -82,13 +82,15 @@ export class WsChatMethodsService {
await rooms.result.update.forEach( async (roomData: room) => {
await this.prepareRoom(roomData);
});
this._dm = this.sortService.sortDate(this._dm,'_updatedAt').reverse()
this._group = this.sortService.sortDate(this._group,'_updatedAt').reverse()
this.loadingWholeList = false
}
subscribeToRoom() {
for (const id in this.dm) {
@@ -141,7 +143,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,
@@ -158,8 +160,6 @@ export class WsChatMethodsService {
let roomId = this.getRoomId(roomData)
if(this.isIndividual(roomData)) {
console.log(room);
this.dm[roomId] = room
this._dm.push(room)
this.dmCount++