This commit is contained in:
tiago.kayaya
2021-01-20 10:23:59 +01:00
parent 874133d28e
commit 38765d4da9
99 changed files with 2696 additions and 18069 deletions
@@ -1,7 +1,7 @@
<ion-content>
<ion-row>
<ion-col>
<button class="btn-cancel" shape="round" >Sair do Grupo</button>
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
</ion-col>
<ion-col>
<button class="btn-ok" shape="round" >Alterar nome do grupo</button>
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { PopoverController } from '@ionic/angular';
import { NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@Component({
selector: 'app-chat-popover',
@@ -7,15 +8,37 @@ import { PopoverController } from '@ionic/angular';
styleUrls: ['./chat-popover.page.scss'],
})
export class ChatPopoverPage implements OnInit {
room:any;
constructor(
private popoverController: PopoverController,
) { }
private navParams: NavParams,
private chatService: ChatService,
) {
this.room = this.navParams.get('room');
}
ngOnInit() {
console.log(this.room);
}
close(){
this.popoverController.dismiss();
}
//Top menu options
leaveGroup(){
let body = { "roomId":this.room._id, }
if(this.room.t === 'p'){
this.chatService.closeGroup(body).subscribe(res=>{
console.log(res);
});
}
else{
this.chatService.closeChannel(body).subscribe(res=>{
console.log(res);
});
}
}
}