mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
remove promise bug
This commit is contained in:
@@ -533,7 +533,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.getRoomInfo();
|
||||
this.closeAllDesktopComponents.emit();
|
||||
this.showEmptyContainer.emit();
|
||||
this.ChatSystemService.hidingRoom(this.roomId);
|
||||
this.ChatSystemService.hidingRoom(this.roomId).catch((error) => console.error(error));
|
||||
}
|
||||
else if (res.data == 'delete') {
|
||||
this.closeAllDesktopComponents.emit();
|
||||
@@ -878,7 +878,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
|
||||
|
||||
|
||||
@@ -812,7 +812,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
|
||||
|
||||
|
||||
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user