mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Delete message in chat completed
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user