This commit is contained in:
tiago.kayaya
2021-01-22 16:01:44 +01:00
95 changed files with 3733 additions and 8202 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>
@@ -12,7 +12,7 @@
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</ion-col>
<ion-col>
<button class="btn-delete" shape="round">Apagar grupo</button>
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
</ion-col>
</ion-row>
</ion-content>
@@ -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,54 @@ 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
//Close
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);
});
}
this.popoverController.dismiss(true);
}
//Delete
deleteGroup(){
let body = { "roomId":this.room._id, }
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
console.log(res);
});
}
else{
this.chatService.deleteChannel(body).subscribe(res=>{
console.log(res);
});
}
this.popoverController.dismiss(true);
}
}