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