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
@@ -28,6 +28,7 @@ export class GroupMessagesPage implements OnInit {
contacts: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
roomId: string;
loggedUserChat:any;
constructor(
private menu: MenuController,
@@ -39,15 +40,14 @@ export class GroupMessagesPage implements OnInit {
private authService: AuthService,
private alertService: AlertService,
) {
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = true;
this.roomId = this.navParams.get('roomId');
}
ngOnInit() {
this.authService.userData$.subscribe((res:any)=>{
this.loggedUser=res;
console.log(this.loggedUser);
});
console.log(this.roomId);
this.loggedUser=this.loggedUserChat;
this.getRoomInfo();
}
@@ -121,17 +121,17 @@ export class GroupMessagesPage implements OnInit {
sendMessage(){
let body = {
"message":
{
"rid": this.roomId, "msg": this.message
"message":
{
"rid": this.roomId, "msg": this.message
}
}
this.chatService.sendMessage(body).subscribe(res=> {
this.getRoomInfo();
},(error) => {
});
this.message = "";
}
@@ -154,7 +154,7 @@ export class GroupMessagesPage implements OnInit {
console.log('cancel');
}
console.log('OK2');
});
}
@@ -172,7 +172,7 @@ export class GroupMessagesPage implements OnInit {
}
async addContacts(){
console.log(this.members);
const modal = await this.modalController.create({
component: GroupContactsPage,
componentProps: {
@@ -180,7 +180,7 @@ export class GroupMessagesPage implements OnInit {
room: this.room,
members: this.members,
name: this.room.name,
},
},
cssClass: 'contacts',
backdropDismiss: false
});
@@ -211,7 +211,7 @@ export class GroupMessagesPage implements OnInit {
handler: () => {
console.log('Play clicked');
}
},
},
]
});
await actionSheet.present();