This commit is contained in:
tiago.kayaya
2021-08-17 14:17:19 +01:00
parent 6714825bb7
commit 13a5ca0702
5 changed files with 42 additions and 23 deletions
+11 -11
View File
@@ -290,17 +290,17 @@ hideRefreshButton(){
this.showLoader = true;
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
this.privateGroups = res.groups;
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels;
let all = this.privateGroups.concat(this.publicGroups);
this.allGroups = all.sort((a,b)=>{
var dateA = new Date(a._updatedAt).getTime();
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
console.log(this.allGroups);
this.showLoader = false;
});
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels; */
//let all = this.privateGroups.concat(this.publicGroups);
this.allGroups = this.privateGroups.sort((a,b)=>{
var dateA = new Date(a._updatedAt).getTime();
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
console.log(this.allGroups);
this.showLoader = false;
/* }); */
});
}