remove promise bug

This commit is contained in:
Eudes Inácio
2022-12-20 17:06:19 +01:00
parent c8d62760ce
commit 111214d231
22 changed files with 128 additions and 42 deletions
@@ -82,9 +82,12 @@ export class ChatPopoverPage implements OnInit {
let body = { "roomId":this.roomId, }
let res:any = await this.ChatSystemService.leaveRoom(this.roomId);
let res:any;
try {
res = await this.ChatSystemService.leaveRoom(this.roomId);
} catch (error) {
console.error(error)
}
if(res.error){
if(res.error.error = "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.");