This commit is contained in:
Peter Maquiran
2022-02-24 14:59:47 +01:00
parent 945dd72142
commit ef0e724f58
15 changed files with 72 additions and 15 deletions
+3 -3
View File
@@ -49,7 +49,7 @@ export class MessageService {
private WsChatService: WsChatService) {
}
setData({customFields, channels, mentions, msg ,rid ,ts, u, t, _id, _updatedAt, file, attachments, temporaryData, localReference}:Message) {
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, _updatedAt, file, attachments, temporaryData, localReference}:Message) {
this.customFields = customFields
this.channels = channels || []
this.mentions = mentions || []
@@ -124,7 +124,7 @@ export class MessageService {
if (environment.chatOffline) {
this.redefinedMessage(ChatMessage)
// this.redefinedMessage(ChatMessage)
this.offline = false
}
@@ -155,7 +155,7 @@ export class MessageService {
let ChatMessage = message.result
if (environment.chatOffline) {
this.redefinedMessage(ChatMessage)
// this.redefinedMessage(ChatMessage)
this.offline = false
}
+2 -2
View File
@@ -11,9 +11,9 @@ export class NfService {
downloadFileMsg = async (message: MessageService, room?: RoomService): Promise<boolean> => new Promise ((resolve, reject)=> (resolve(true)));
fix_updatedAt(message) {
if (message.result) {
if (message?.result) {
message.result._updatedAt = message.result._updatedAt['$date']
} else if(message._updatedAt) {
} else if(message?._updatedAt) {
if(message._updatedAt.hasOwnProperty('$date')) {
message._updatedAt = message._updatedAt['$date']
}
+2 -2
View File
@@ -71,7 +71,7 @@ export class RoomService {
this.NativeNotificationService.askForPermission()
}
setData({ customFields, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService), _updatedAt }) {
setData({ customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService), _updatedAt }) {
this.customFields = customFields
this.id = id
this.name = name
@@ -184,7 +184,7 @@ export class RoomService {
let index;
const find = messages.find((message, _index)=> {
if(message.localReference) {
if(message.localReference == ChatMessage.localReference) {
if(message?.localReference == ChatMessage?.localReference) {
index = _index
return true
}