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