mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
save
This commit is contained in:
@@ -19,6 +19,7 @@ import { MessagesPage } from './messages/messages.page';
|
||||
import { NewGroupPage } from './new-group/new-group.page';
|
||||
import { NewchatPage } from './newchat/newchat.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
@@ -76,6 +77,7 @@ export class ChatPage implements OnInit {
|
||||
private authService: AuthService,
|
||||
private storage:Storage,
|
||||
private resolver: ComponentFactoryResolver,
|
||||
private alertService: AlertService,
|
||||
|
||||
) {
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user