mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add progress bar
This commit is contained in:
@@ -13,6 +13,7 @@ import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||
styleUrls: ['./messages.page.scss'],
|
||||
})
|
||||
export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
showLoader: boolean;
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
|
||||
@@ -43,21 +44,21 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
this.loggedUser=res;
|
||||
console.log(this.loggedUser);
|
||||
});
|
||||
|
||||
/* console.log(this.dm); */
|
||||
|
||||
/* setInterval(()=>{ */
|
||||
this.loadMessages();
|
||||
/* }, 2000); */
|
||||
|
||||
this.load();
|
||||
/* }, 9000); */
|
||||
|
||||
}
|
||||
load(){
|
||||
this.loadMessages();
|
||||
this.getChatMembers();
|
||||
|
||||
|
||||
}
|
||||
loadUser(){
|
||||
console.log('working');
|
||||
|
||||
doRefresh(ev:any){
|
||||
this.load();
|
||||
ev.target.complete();
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
this.scrollToBottom();
|
||||
}
|
||||
@@ -86,6 +87,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
}
|
||||
|
||||
loadMessages(){
|
||||
this.showLoader = true;
|
||||
this.chatService.getRoomMessages(this.dm._id).subscribe(res => {
|
||||
/* console.log(res); */
|
||||
this.messages = res['messages'].reverse();
|
||||
@@ -94,10 +96,12 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
})
|
||||
}
|
||||
getChatMembers(){
|
||||
this.showLoader = true;
|
||||
this.chatService.getMembers(this.dm._id).subscribe(res=> {
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
|
||||
console.log(res);
|
||||
console.log(this.dmUsers);
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user