This commit is contained in:
tiago.kayaya
2021-08-17 14:17:19 +01:00
parent 6714825bb7
commit 13a5ca0702
5 changed files with 42 additions and 23 deletions
@@ -16,7 +16,7 @@ export class ChatPopoverPage implements OnInit {
private modalController: ModalController,
private navParams: NavParams,
private chatService: ChatService,
) {
) {
this.roomId = this.navParams.get('roomId');
}
@@ -39,18 +39,18 @@ export class ChatPopoverPage implements OnInit {
//Close
leaveGroup(){
console.log('leave');
let body = { "roomId":this.roomId, }
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
if(this.room.t === 'p'){
if(this.room.t === 'p'){
this.chatService.leaveGroup(body).subscribe(res=>{
console.log(res);
});
}
else{
else{
this.chatService.leaveChannel(body).subscribe(res=>{
console.log(res);
});
@@ -66,12 +66,12 @@ export class ChatPopoverPage implements OnInit {
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
if(this.room.t === 'p'){
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
console.log(res);
});
}
else{
else{
this.chatService.deleteChannel(body).subscribe(res=>{
console.log(res);
});
@@ -82,6 +82,7 @@ export class ChatPopoverPage implements OnInit {
}
async openChangeGroupName(){
this.popoverController.dismiss('edit');
this.modalController.dismiss('edit');
}