This commit is contained in:
Peter Maquiran
2022-03-25 17:39:51 +01:00
parent f2cf316329
commit e2721f1091
2 changed files with 13 additions and 10 deletions
+6 -5
View File
@@ -238,7 +238,6 @@ export class RoomService {
const args = message.fields.args
// alert(JSON.stringify(args))
if (typeof args[1] != 'object') {
@@ -367,8 +366,7 @@ export class RoomService {
if(this.messages[i]?._id == id ) {
console.log(_id,'==',this.messages[i]?._id, true)
this.messages.splice(i, 1)
//Get previous last message from room
const previousLastMessage = this.messages.slice(-1)[0];
@@ -377,7 +375,7 @@ export class RoomService {
this.calDateDuration(previousLastMessage._updatedAt)
this.sortRoomList()
if (SessionStore.user.RochetChatUser == this.messages[i].u.username) {
if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) {
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
DeleteMessageModel.create({
@@ -389,7 +387,10 @@ export class RoomService {
})
}
this.messages[i].delateDB()
this.messages[i]?.delateDB()
console.log(_id,'==',this.messages[i]?._id, true)
this.messages.splice(i, 1)
return true