mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
This commit is contained in:
parent
1bb154d6f4
commit
39f39db447
1 changed files with 24 additions and 32 deletions
|
|
@ -1048,7 +1048,30 @@ class ComposePopupView extends AbstractViewNext {
|
|||
|
||||
const downloads = this.getAttachmentsDownloadsForUpload();
|
||||
if (Array.isNotEmpty(downloads)) {
|
||||
Remote.messageUploadAttachments(()=>this.onMessageUploadAttachments(), downloads);
|
||||
Remote.messageUploadAttachments((sResult, oData) => {
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result) {
|
||||
Object.entries(oData.Result).forEach(([tempName, id]) => {
|
||||
const attachment = this.getAttachmentById(id);
|
||||
if (attachment) {
|
||||
attachment.tempName(tempName);
|
||||
attachment
|
||||
.waiting(false)
|
||||
.uploading(false)
|
||||
.complete(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.attachments().forEach(attachment => {
|
||||
if (attachment && attachment.fromMessage) {
|
||||
attachment
|
||||
.waiting(false)
|
||||
.uploading(false)
|
||||
.complete(true)
|
||||
.error(getUploadErrorDescByCode(UploadErrorCode.FileNoUploaded));
|
||||
}
|
||||
});
|
||||
}
|
||||
}, downloads);
|
||||
}
|
||||
|
||||
if (identity) {
|
||||
|
|
@ -1056,25 +1079,6 @@ class ComposePopupView extends AbstractViewNext {
|
|||
}
|
||||
}
|
||||
|
||||
onMessageUploadAttachments(sResult, oData) {
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result) {
|
||||
if (!this.viewModelVisibility()) {
|
||||
oData.Result.forEach((id, tempName) => {
|
||||
const attachment = this.getAttachmentById(id);
|
||||
if (attachment) {
|
||||
attachment.tempName(tempName);
|
||||
attachment
|
||||
.waiting(false)
|
||||
.uploading(false)
|
||||
.complete(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setMessageAttachmentFailedDownloadText();
|
||||
}
|
||||
}
|
||||
|
||||
setFocusInPopup() {
|
||||
if (!bMobileDevice) {
|
||||
setTimeout(() => {
|
||||
|
|
@ -1404,18 +1408,6 @@ class ComposePopupView extends AbstractViewNext {
|
|||
}
|
||||
}
|
||||
|
||||
setMessageAttachmentFailedDownloadText() {
|
||||
this.attachments().forEach(attachment => {
|
||||
if (attachment && attachment.fromMessage) {
|
||||
attachment
|
||||
.waiting(false)
|
||||
.uploading(false)
|
||||
.complete(true)
|
||||
.error(getUploadErrorDescByCode(UploadErrorCode.FileNoUploaded));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean=} includeAttachmentInProgress = true
|
||||
* @returns {boolean}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue