mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
fix
This commit is contained in:
@@ -77,17 +77,21 @@ export class MessageService {
|
|||||||
this._id = _id
|
this._id = _id
|
||||||
this._updatedAt = _updatedAt || new Date().getTime()
|
this._updatedAt = _updatedAt || new Date().getTime()
|
||||||
this.file = file
|
this.file = file
|
||||||
this.attachments = attachments
|
|
||||||
this.temporaryData = temporaryData
|
this.temporaryData = temporaryData
|
||||||
this.localReference = localReference || null
|
this.localReference = localReference || null
|
||||||
this.id = id
|
this.id = id
|
||||||
this.delate = delate
|
this.delate = delate
|
||||||
this.delateRequest = delateRequest
|
this.delateRequest = delateRequest
|
||||||
|
|
||||||
|
if(this.attachments?.length >= 1 && attachments?.length >= 1) {
|
||||||
|
this.attachments[0] = Object.assign(this.attachments[0], attachments[0])
|
||||||
|
} else {
|
||||||
|
this.attachments = attachments
|
||||||
|
}
|
||||||
|
|
||||||
this.viewed = [...new Set([...viewed,...this.viewed])];
|
this.viewed = [...new Set([...viewed,...this.viewed])];
|
||||||
this.received = [...new Set([...received,...this.received])];
|
this.received = [...new Set([...received,...this.received])];
|
||||||
|
|
||||||
|
|
||||||
if(!this.ts) {
|
if(!this.ts) {
|
||||||
this.offline = true
|
this.offline = true
|
||||||
this.messageSend = false
|
this.messageSend = false
|
||||||
@@ -105,11 +109,9 @@ export class MessageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this.hasFile) {
|
if(this.hasFile) {
|
||||||
|
|
||||||
if(this.file.type != 'application/webtrix') {
|
if(this.file.type != 'application/webtrix') {
|
||||||
this.displayType = this.file.type.replace('application/','').toUpperCase()
|
this.displayType = this.file.type.replace('application/','').toUpperCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calDateDuration()
|
this.calDateDuration()
|
||||||
|
|||||||
@@ -238,7 +238,6 @@ export class RoomService {
|
|||||||
|
|
||||||
const args = message.fields.args
|
const args = message.fields.args
|
||||||
|
|
||||||
// alert(JSON.stringify(args))
|
|
||||||
|
|
||||||
|
|
||||||
if (typeof args[1] != 'object') {
|
if (typeof args[1] != 'object') {
|
||||||
@@ -367,8 +366,7 @@ export class RoomService {
|
|||||||
|
|
||||||
if(this.messages[i]?._id == id ) {
|
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
|
//Get previous last message from room
|
||||||
const previousLastMessage = this.messages.slice(-1)[0];
|
const previousLastMessage = this.messages.slice(-1)[0];
|
||||||
@@ -377,7 +375,7 @@ export class RoomService {
|
|||||||
this.calDateDuration(previousLastMessage._updatedAt)
|
this.calDateDuration(previousLastMessage._updatedAt)
|
||||||
this.sortRoomList()
|
this.sortRoomList()
|
||||||
|
|
||||||
if (SessionStore.user.RochetChatUser == this.messages[i].u.username) {
|
if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) {
|
||||||
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
|
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
|
||||||
|
|
||||||
DeleteMessageModel.create({
|
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
|
return true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user