bug fix in chat view

This commit is contained in:
tiago.kayaya
2022-01-28 15:31:52 +01:00
parent 8756462665
commit 5a214aebf4
12 changed files with 145 additions and 49 deletions
+9 -5
View File
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import { AlertController, AnimationController } from '@ionic/angular';
import { ChatService } from './chat.service';
import { WsChatMethodsService } from './chat/ws-chat-methods.service';
import { ToastService } from './toast.service';
@Injectable({
@@ -13,6 +14,7 @@ export class AlertService {
private animationController: AnimationController,
private chatService: ChatService,
private toastService: ToastService,
public wsChatMethodsService: WsChatMethodsService,
) { }
async presentAlert(message:string) {
@@ -40,7 +42,9 @@ export class AlertService {
}, 2500);
}
async confirmDeleteMessage(body:any) {
async confirmDeleteMessage(msgId:any, room:any) {
console.log(room);
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Apagar a mensagem?',
@@ -55,10 +59,10 @@ export class AlertService {
}, {
text: 'Apagar',
handler: () => {
const loader = this.toastService.loading();
this.chatService.deleteMessage(body).subscribe(res=>{
loader.remove();
});
//const loader = this.toastService.loading();
this.wsChatMethodsService.deleteMessage(msgId);
//this.wsChatMethodsService.subscribeToRoomUpdate(room._id, room);
//loader.remove();
}
}
]