remove promise bug

This commit is contained in:
Eudes Inácio
2022-12-20 17:06:19 +01:00
parent c8d62760ce
commit 111214d231
22 changed files with 128 additions and 42 deletions
+17 -5
View File
@@ -166,7 +166,11 @@ export class MessageService {
let uploadSuccessfully = false
if(this.hasSendAttachment == false) {
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
try {
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
} catch (error) {
console.error('beforeSendAttachment uploadSuccessfully',error)
}
this.UploadAttachmentsTemp++
}
@@ -186,13 +190,17 @@ export class MessageService {
this.RochetChatConnectorService.registerCallback({
type: 'reConnect',
funx: async ()=> {
this.send()
this.send().catch((error) =>{
console.error(error)
})
return true
}
})
} else if(uploadSuccessfully == false && this.UploadAttachmentsTemp == 1) {
this.send()
this.send().catch((error) =>{
console.error(error)
})
}
else if(uploadSuccessfully == false) {
@@ -225,7 +233,9 @@ export class MessageService {
this.messageSend = true
this.redefinedMessage(ChatMessage)
}
)
).catch((error) => {
console.error(error)
})
} else {
// console.log("reconnect")
@@ -233,7 +243,9 @@ export class MessageService {
type: 'reConnect',
funx: async ()=> {
this.send()
this.send().catch((error) =>{
console.error(error)
})
return true
}
})