Listening to chat in the interval of 2mins

This commit is contained in:
tiago.kayaya
2021-01-13 11:05:21 +01:00
parent 586651e95e
commit ed84132a9e
2 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -67,11 +67,10 @@ export class ChatPage implements OnInit {
this.doRefresh(); this.doRefresh();
} }
doRefresh(){ doRefresh(){
setInterval(()=>{
this.getDirectMessages(); this.getDirectMessages();
/* this.getConnectedRooms(); */
/* this.getConnectedChannels(); */
this.getGroups(); this.getGroups();
/* this.getConnectedUsers(); */ }, 2000);
} }
getGroups(){ getGroups(){
this.showLoader = true; this.showLoader = true;
+1 -1
View File
@@ -86,9 +86,9 @@ export class MessagesPage implements OnInit, AfterViewChecked {
} }
this.chatService.sendMessage(body).subscribe(res=> { this.chatService.sendMessage(body).subscribe(res=> {
/* console.log(res); */
this.loadMessages(); this.loadMessages();
}); });
this.message = "";
} }
loadMessages(){ loadMessages(){