mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
bug fix in chat view
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user