This commit is contained in:
tiago.kayaya
2021-04-13 11:34:52 +01:00
parent 35ab6c15c8
commit 10683b7263
5 changed files with 20 additions and 7 deletions
@@ -98,6 +98,8 @@ export class ContactsPage implements OnInit {
this.chatService.createRoom(body).subscribe(res => {
console.log(res);
this.room = res['room'];
console.log(this.room._id);
this.getDirectMessage(this.room._id);
});
}
@@ -106,21 +108,22 @@ export class ContactsPage implements OnInit {
this.chatService.getAllDirectMessages().subscribe(res=>{
let result = res['ims'].filter(data => data._id == roomId);
console.log(result[0]);
this.dm = result[0];
console.log(this.dm);
this.openModal(this.dm);
this.openModal(this.dm._id);
});
}
async openModal(dm:any){
async openModal(roomId:any){
this.close();
console.log(dm);
console.log(roomId);
const modal = await this.modalController.create({
component: MessagesPage,
cssClass: 'group-messages',
backdropDismiss: false,
componentProps: {
dm: dm,
roomId: roomId,
},
});
await modal.present();