This commit is contained in:
tiago.kayaya
2021-01-19 09:26:33 +01:00
parent fb1b148c33
commit 08ec18a4d4
250 changed files with 4298 additions and 3234 deletions
+10 -3
View File
@@ -86,9 +86,16 @@ export class ChatPage implements OnInit {
getDirectMessages(){
this.showLoader = true;
this.result = this.chatService.getAllDirectMessages().subscribe((res:any)=>{
this.userDirectMessages = res.ims;
console.log(res);
/* this.result = */
this.chatService.getAllDirectMessages().subscribe((res:any)=>{
console.log(res.ims);
this.userDirectMessages = res.ims.sort((a,b)=>{
var dateA = new Date(a.lastMessage._updatedAt).getTime();
var dateB = new Date(b.lastMessage._updatedAt).getTime();
return dateB - dateB;
});
console.log(this.userDirectMessages);
this.showLoader = false;
});