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,6 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-popover',
|
||||
@@ -16,6 +17,7 @@ export class ChatPopoverPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private chatService: ChatService,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
}
|
||||
@@ -24,14 +26,14 @@ export class ChatPopoverPage implements OnInit {
|
||||
console.log(this.roomId);
|
||||
}
|
||||
|
||||
close(){
|
||||
close(action:any){
|
||||
if( window.innerWidth <= 701){
|
||||
this.popoverController.dismiss('cancel');
|
||||
this.modalController.dismiss('cancel');
|
||||
this.popoverController.dismiss(action);
|
||||
this.modalController.dismiss(action);
|
||||
}
|
||||
else{
|
||||
this.popoverController.dismiss('cancel');
|
||||
this.modalController.dismiss('cancel');
|
||||
this.popoverController.dismiss(action);
|
||||
this.modalController.dismiss(action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,16 +50,28 @@ export class ChatPopoverPage implements OnInit {
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.leaveGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close('leave');
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest("Não foi possível sair do grupo")
|
||||
},
|
||||
()=>{
|
||||
//loader.remove()
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.chatService.leaveChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close('leave');
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest("Não foi possível sair do grupo")
|
||||
},
|
||||
()=>{
|
||||
//loader.remove()
|
||||
});
|
||||
}
|
||||
});
|
||||
this.popoverController.dismiss('leave');
|
||||
this.modalController.dismiss('leave');
|
||||
}
|
||||
|
||||
//Delete
|
||||
|
||||
Reference in New Issue
Block a user