This commit is contained in:
tiago.kayaya
2021-07-23 14:43:51 +01:00
parent 9bcc06add2
commit b5e1ad4201
17 changed files with 194 additions and 203 deletions
@@ -30,11 +30,9 @@ export class ContactsPage implements OnInit {
private http: HttpClient,
private chatService: ChatService,
private authService: AuthService,
)
{
this.authService.userData$.subscribe((res:any)=>{
this.loggedUser=res;
});
)
{
this.loggedUser = authService.ValidatedUserChat['data'];
this.textSearch="";
this.dm=null;
this.room=null;
@@ -65,7 +63,7 @@ export class ContactsPage implements OnInit {
}
loadUsers(){
this.options = {
this.options = {
headers: this.headers,
};
this.chatService.getAllUsers().subscribe((res:any)=>{
@@ -105,7 +103,7 @@ export class ContactsPage implements OnInit {
close(){
this.modalController.dismiss();
}
clicked(){
console.log('clicked');
}
@@ -122,7 +120,7 @@ export class ContactsPage implements OnInit {
}
getDirectMessage(roomId:any){
console.log(roomId);
this.chatService.getAllDirectMessages().subscribe(res=>{
let result = res['ims'].filter(data => data._id == roomId);
this.dm = result[0];
@@ -133,7 +131,7 @@ export class ContactsPage implements OnInit {
async openModal(dm:any){
this.close();
console.log(dm);
const modal = await this.modalController.create({
component: MessagesPage,
cssClass: 'group-messages',
@@ -155,8 +153,8 @@ export class ContactsPage implements OnInit {
//Get direct messages (dm)
/* this.getDirectMessage(this.room._id); */
console.log(this.dm);
/* const modal = await this.modalController.create({
component: MessagesPage,
cssClass: 'group-messages',