This commit is contained in:
tiago.kayaya
2022-01-28 19:04:46 +01:00
5 changed files with 50 additions and 9 deletions
@@ -47,6 +47,19 @@ export class WsChatMethodsService {
const sortedRoomList = this.sortService.sortDate(rooms.result.update, "_updatedAt.$date")
this.WsChatService.registerCallback({
type:'Onmessage',
funx:(message)=>{
if(message.msg =='changed' && message.collection == "stream-room-messages") {
if(message.fields.args[0].rid) {
const sortedRoomList = this.sortService.sortDate(rooms.result.update, "_updatedAt.$date")
}
}
}
})
console.log(rooms.result.update);
console.log(sortedRoomList);
@@ -57,9 +70,27 @@ export class WsChatMethodsService {
this.prepareRoom(roomData);
});
/* function compare( a, b ) {
if ( a.last_nom < b.last_nom ){
return -1;
}
if ( a.last_nom > b.last_nom ){
return 1;
}
return 0;
}
this.dm.sort(compare); */
console.log(this.dm);
this.loadingWholeList = false
}
subscribeToRoom() {
for (const id in this.dm) {