This commit is contained in:
Peter Maquiran
2022-09-28 21:05:28 +01:00
parent aa72837f66
commit 4c8e522d40
4 changed files with 43 additions and 10 deletions
+9 -1
View File
@@ -59,6 +59,7 @@ export class MessageService {
downloadLoader: boolean = false
downloadAttachments = false;
downloadAttachmentsTemp = 0;
UploadAttachmentsTemp = 0;
constructor(private storage: Storage,
private NfService: NfService,
@@ -150,11 +151,13 @@ export class MessageService {
let uploadSuccessfully = false
if(this.hasSendAttachment == false) {
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
this.UploadAttachmentsTemp++
}
this.uploadingFile = false
if(uploadSuccessfully) {
this.hasSendAttachment = true
this.errorUploadingAttachment = false
this.temporaryData = {}
@@ -163,6 +166,7 @@ export class MessageService {
await this.sendRequest(params)
} else if(this.WsChatService.isLogin == false) {
this.WsChatService.registerCallback({
type: 'reConnect',
funx: async ()=> {
@@ -171,7 +175,11 @@ export class MessageService {
}
})
} else if(uploadSuccessfully == false) {
} else if(uploadSuccessfully == false && this.UploadAttachmentsTemp == 1) {
this.send()
}
else if(uploadSuccessfully == false) {
this.errorUploadingAttachment = true
return new Promise((resolve, reject) => {