This commit is contained in:
Peter Maquiran
2022-02-10 19:07:38 +01:00
parent 78d94a461c
commit 19c2286a4a
3 changed files with 12 additions and 6 deletions
+6 -4
View File
@@ -110,7 +110,9 @@ export class MessageService {
let ChatMessage = message.result
if (environment.chatOffline) {
this.redefinedMessage(this, ChatMessage)
this.redefinedMessage(ChatMessage)
alert('redifie')
this.offline = false
}
@@ -138,7 +140,7 @@ export class MessageService {
let ChatMessage = message.result
if (environment.chatOffline) {
this.redefinedMessage(this, ChatMessage)
this.redefinedMessage(ChatMessage)
this.offline = false
}
@@ -157,7 +159,7 @@ export class MessageService {
} else if(uploadSuccessfully == false) {
this.errorUploadingAttachment = true
return new Promise((resolve, reject)=>{
reject(false)
})
@@ -167,7 +169,7 @@ export class MessageService {
}
}
redefinedMessage(message, ChatMessage) {
redefinedMessage(ChatMessage) {
ChatMessage = this.NfService.fix_updatedAt(ChatMessage)
this.setData(ChatMessage)
}
+5 -1
View File
@@ -98,6 +98,7 @@ export class RoomService {
setTimeout(()=>{
let ChatMessage = _ChatMessage.fields.args[0]
ChatMessage = this.fix_updatedAt(ChatMessage)
if (environment.chatOffline) alert('receive')
const message = this.prepareMessage(ChatMessage)
this.lastMessage = message
this.calDateDuration(ChatMessage._updatedAt)
@@ -394,6 +395,7 @@ export class RoomService {
if(wewMessage.offline == false) {
this.prepareMessage(ChatMessage)
} else {
if(environment.chatOffline) alert('create offline')
const offlineMessage = this.prepareMessage(ChatMessage)
offlineMessage.send().then(()=>{
this.updateMessageDB(ChatMessage, ChatMessage.localReference)
@@ -451,7 +453,8 @@ export class RoomService {
wewMessage.loadHistory = this.hasLoadHistory
if(!message._id && environment.chatOffline) {
if(this.hasLoadHistory && environment.chatOffline) alert('create offline')
this.messages.push(wewMessage)
return wewMessage
}
@@ -466,6 +469,7 @@ export class RoomService {
})
if (save && !found) {
if(this.hasLoadHistory && environment.chatOffline) alert('not found')
this.messages.push(wewMessage)
}
+1 -1
View File
@@ -13,7 +13,7 @@ export const environment = {
domain: 'gabinetedigital.local', //gabinetedigital.local
defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local
defaultuserpwd: 'tabteste@006', //tabteste@006,
chatOffline: true
chatOffline: false
};
/*