Delete message in chat completed

This commit is contained in:
tiago.kayaya
2021-09-28 15:23:51 +01:00
parent 4f61719f59
commit 988711a104
11 changed files with 94 additions and 29 deletions
+15 -7
View File
@@ -192,6 +192,18 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.message = "";
}
deleteMessage(msgId:string){
let body = {
"roomId": this.roomId,
"msgId": msgId,
"asUser": false,
}
this.alertService.confirmDeleteMessage(body);
/* this.chatService.deleteMessage(body).subscribe(res=>{
console.log(res);
}); */
}
loadMessages(){
//this.showLoader = true;
const roomId = this.roomId
@@ -207,10 +219,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}); */
//this.showLoader = false;
})
}2
deleteMessage(){
alert('This');
}
viewDocument(url:string){
@@ -404,17 +412,17 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId;
this.chatService.getRoomMessages(this.roomId).subscribe(async res => {
console.log(res['success']);
//console.log(res['success']);
if (res['success'] == true) {
// Show Error
//showMessage(response.statusText);
//this.loadMessages()
this.loadMessages()
this.messages = res['messages'].reverse();
this.chatMessageStore.add(roomId, this.messages)
console.log(this.messages);
//console.log(this.messages);
// Reconnect in one second
if(this.route.url != "/home/chat"){
console.log("Timer message stop")