mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -115,7 +115,7 @@ export class ChatPage implements OnInit {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private storage:Storage,
|
private storage:Storage,
|
||||||
private resolver: ComponentFactoryResolver,
|
private resolver: ComponentFactoryResolver,
|
||||||
private router: Router,
|
private route: Router,
|
||||||
){
|
){
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
@@ -355,20 +355,34 @@ hideRefreshButton(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getDirectMessages(){
|
async getDirectMessages(){
|
||||||
this.showLoader = true;
|
|
||||||
|
|
||||||
this.chatService.getAllDirectMessages().subscribe((res:any)=>{
|
this.chatService.getAllDirectMessages().subscribe(async (res:any)=>{
|
||||||
console.log(res.ims);
|
|
||||||
|
|
||||||
this.userDirectMessages = res.ims.sort((a,b)=>{
|
if(res.ims != 200){
|
||||||
var dateA = new Date(a._updatedAt).getTime();
|
console.log(res.ims);
|
||||||
var dateB = new Date(b._updatedAt).getTime();
|
this.userDirectMessages = res.ims.sort((a,b)=>{
|
||||||
return dateB - dateA;
|
var dateA = new Date(a._updatedAt).getTime();
|
||||||
});
|
var dateB = new Date(b._updatedAt).getTime();
|
||||||
console.log(this.userDirectMessages);
|
return dateB - dateA;
|
||||||
this.showLoader = false;
|
});
|
||||||
|
console.log(this.userDirectMessages);
|
||||||
|
|
||||||
|
if(this.route.url != "/home/chat"){
|
||||||
|
console.log("Timer message stop")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//Check if modal is opened
|
||||||
|
if(this.segment == "Contactos"){
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||||
|
await this.getDirectMessages();
|
||||||
|
console.log('Timer contactos list running')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
await this.getDirectMessages();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,9 +432,12 @@ hideRefreshButton(){
|
|||||||
console.log(this.dmUsers);
|
console.log(this.dmUsers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getGroups(){
|
|
||||||
this.showLoader = true;
|
async getGroups(){
|
||||||
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
|
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res:any)=>{
|
||||||
|
|
||||||
|
if(res.groups != 200){
|
||||||
|
|
||||||
this.privateGroups = res.groups;
|
this.privateGroups = res.groups;
|
||||||
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||||
this.publicGroups = res.channels; */
|
this.publicGroups = res.channels; */
|
||||||
@@ -431,8 +448,24 @@ hideRefreshButton(){
|
|||||||
return dateB - dateA;
|
return dateB - dateA;
|
||||||
});
|
});
|
||||||
console.log(this.allGroups);
|
console.log(this.allGroups);
|
||||||
this.showLoader = false;
|
|
||||||
/* }); */
|
/* }); */
|
||||||
|
if(this.route.url != "/home/chat"){
|
||||||
|
console.log("Timer message stop")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//Check if modal is opened
|
||||||
|
if(this.segment == "Grupos"){
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||||
|
await this.getGroups();
|
||||||
|
console.log('Timer groups list running')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
await this.getGroups();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user