diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index 1e4443a52..5129df36f 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -158,19 +158,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { } deleteMessage(msgId: string) { - let body = { - "roomId": this.roomId, - "msgId": msgId, - "asUser": false, - } - if (msgId) { - //this.alertService.confirmDeleteMessage(body); - } - else { - this.toastService.badRequest('Não foi possível apagar'); - } - this.showMessageOptions = false; - this.selectedMsgId = ""; + const room = this.wsChatMethodsService.getGroupRoom(this.roomId) + this.alertService.confirmDeleteMessage(msgId, room); } ngAfterViewInit() { @@ -374,6 +363,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { close() { this.modalController.dismiss(); + this.deleteRecording(this.lastAudioRecorded); } doRefresh(ev: any) { diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 1b715d7e6..1a21ad9da 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -313,19 +313,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } deleteMessage(msgId: string) { - let body = { - "roomId": this.roomId, - "msgId": msgId, - "asUser": false, - } - if (msgId) { - //this.alertService.confirmDeleteMessage(body); - } - else { - this.toastService.badRequest('Não foi possível apagar'); - } - this.showMessageOptions = false; - this.selectedMsgId = ""; + const room = this.wsChatMethodsService.getDmRoom(this.roomId) + this.alertService.confirmDeleteMessage(msgId, room); } @@ -335,6 +324,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { close() { this.modalController.dismiss(); + this.deleteRecording(this.lastAudioRecorded); } load() {