This commit is contained in:
Peter Maquiran
2022-06-08 16:09:40 +01:00
parent b3186c6eed
commit 16ae54d8d1
8 changed files with 114 additions and 156 deletions
@@ -79,9 +79,6 @@ export class ChatPopoverPage implements OnInit {
let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId);
this.wsChatMethodsService.deleteRoom(this.roomId)
if(res.error){
if(res.error.error = "error-you-are-last-owner"){
@@ -101,55 +98,7 @@ export class ChatPopoverPage implements OnInit {
}
this.close('leave');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, res.result);
/* this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
if(this.room.t === 'p'){
this.chatService.leaveGroup(body).subscribe(res=>{
this.close('leave');
},
(e)=>{
if(e.error.errorType = "error-you-are-last-owner"){
this.toastService._badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
this.close('cancel');
this.setRoomOwner();
}
else{
this.toastService._badRequest("Não foi possível sair do grupo");
this.close('cancel');
}
},
()=>{
//loader.remove()
});
}
else{
this.chatService.leaveChannel(body).subscribe(res=>{
this.close('leave');
},
(e)=>{
if(e.error.errorType = "error-you-are-last-owner"){
this.toastService._badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
this.close('cancel');
}
else{
this.toastService._badRequest("Não foi possível sair do grupo");
this.close('cancel');
}
},
()=>{
//loader.remove()
});
}
}); */
}
//Delete
@@ -160,12 +109,12 @@ export class ChatPopoverPage implements OnInit {
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.roomId)
});
}
else{
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.roomId)
});
}
});