This commit is contained in:
tiago.kayaya
2021-08-30 18:56:37 +01:00
parent 6de36445ab
commit 8de8e23212
5 changed files with 18 additions and 7 deletions
+10 -5
View File
@@ -374,11 +374,11 @@ hideRefreshButton(){
});
}
async getDirectMessages(){
async getDirectMessages(event?){
this.chatService.getAllDirectMessages().subscribe(async (res:any)=>{
if(res.ims != 200){
if(res != 200){
console.log(res.ims);
this.userDirectMessages = res.ims.sort((a,b)=>{
var dateA = new Date(a._updatedAt).getTime();
@@ -391,12 +391,17 @@ hideRefreshButton(){
console.log("Timer message stop")
}
else {
console.log('TIMER');
//Check if modal is opened
if(this.segment == "Contactos" && this.showMessages != true){
await new Promise(resolve => setTimeout(resolve, 5000));
await new Promise(resolve => setTimeout(resolve, 2000));
await this.getDirectMessages();
console.log('Timer contactos list running')
}
else{
console.log('No timer!');
}
}
}
else{
@@ -452,7 +457,7 @@ hideRefreshButton(){
});
}
async getGroups(){
async getGroups(event?){
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res:any)=>{
if(res.groups != 200){
@@ -474,7 +479,7 @@ hideRefreshButton(){
else {
//Check if modal is opened
if(this.segment == "Grupos" && this.showGroupMessages != true){
await new Promise(resolve => setTimeout(resolve, 5000));
await new Promise(resolve => setTimeout(resolve, 2000));
await this.getGroups();
console.log('Timer groups list running')
}