mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user