mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
remove duplicate
This commit is contained in:
@@ -77,7 +77,7 @@ export class MessageService {
|
|||||||
this.ts = ts
|
this.ts = ts
|
||||||
this.u = u || { name: this.usernameToDisplayName(SessionStore.user.UserName), username: SessionStore.user.UserName, _id: ""}
|
this.u = u || { name: this.usernameToDisplayName(SessionStore.user.UserName), username: SessionStore.user.UserName, _id: ""}
|
||||||
this.t = t
|
this.t = t
|
||||||
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.temporaryData = temporaryData
|
this.temporaryData = temporaryData
|
||||||
|
|||||||
@@ -530,9 +530,9 @@ export class RoomService {
|
|||||||
|
|
||||||
this.message= ''
|
this.message= ''
|
||||||
|
|
||||||
|
this.messagesLocalReference.push(localReference)
|
||||||
const message: MessageService = await this.prepareCreate({message:offlineChatMessage, save: environment.chatOffline})
|
const message: MessageService = await this.prepareCreate({message:offlineChatMessage, save: environment.chatOffline})
|
||||||
|
|
||||||
this.messagesLocalReference.push(localReference)
|
|
||||||
await message.addMessageDB()
|
await message.addMessageDB()
|
||||||
message.send()
|
message.send()
|
||||||
|
|
||||||
@@ -822,7 +822,33 @@ export class RoomService {
|
|||||||
wewMessage.setData(message)
|
wewMessage.setData(message)
|
||||||
wewMessage.loadHistory = this.hasLoadHistory
|
wewMessage.loadHistory = this.hasLoadHistory
|
||||||
|
|
||||||
this.messages.push(wewMessage)
|
|
||||||
|
let found;
|
||||||
|
|
||||||
|
if(wewMessage.localReference != null) {
|
||||||
|
found = this.messages.find((MessageService, index) => {
|
||||||
|
if ( MessageService.localReference == wewMessage.localReference ) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
found = this.messages.find((MessageService, index) => {
|
||||||
|
if ( MessageService._id == wewMessage._id) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
this.messages.push(wewMessage)
|
||||||
|
return wewMessage
|
||||||
|
}
|
||||||
|
|
||||||
return wewMessage
|
return wewMessage
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-label>{{msg.u.name}}</ion-label>
|
<ion-label>{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{msg.duration}}</span>
|
<span class="time">{{msg.duration}}</span>
|
||||||
<!-- {{msg._id}} -->
|
{{msg._id}}
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-space-between">
|
<div class="d-flex justify-space-between">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user