fix chat delete message

This commit is contained in:
Peter Maquiran
2023-01-18 14:40:12 +01:00
parent b890b58a86
commit 16de340501
6 changed files with 19 additions and 17 deletions
-6
View File
@@ -115,7 +115,6 @@ export class ChatPage implements OnInit {
public ChatSystemService: ChatSystemService,
) {
this.loggedUserChat = SessionStore.user.ChatData?.data;
this.headers = new HttpHeaders();
window.onresize = (event) => {
if (window.innerWidth > 701) {
@@ -591,11 +590,8 @@ export class ChatPage implements OnInit {
return dateB - dateA;
});
//
})
}
}
@@ -617,7 +613,6 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt
}
groupsArray.push(roomList)
});
@@ -636,7 +631,6 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt
}
this.sqlservice.addChatListRoom(roomList);
});
}
+4 -2
View File
@@ -446,9 +446,11 @@ export class MessageService {
async delateDB() {
const message = await MessageModel.get({id: this.id})
await message.delete()
if(!this.rowInstance) {
this.rowInstance = await this.getRowInstance()
}
await this.rowInstance.delete()
}
+7 -1
View File
@@ -452,7 +452,13 @@ export class RoomService {
"stream-notify-room",
async (ChatMessage) => {
const DeletedMessageId = ChatMessage.fields.args[0]._id;
this.deleteMessage(DeletedMessageId)
const message = this.messages.find((e) => e._id == DeletedMessageId)
if(message.delate == false) {
this.deleteMessage(DeletedMessageId)
}
}
)
}
-1
View File
@@ -4,7 +4,6 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable, from } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { UserSession } from '../models/user.model';
import { EventList } from '../models/agenda/AgendaEventList';
import { ChangeProfileService } from './change-profile.service';
import { OfflineManagerService } from 'src/app/services/offline-manager.service';