mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Resolve #992
This commit is contained in:
parent
0144be49bf
commit
d8b05ee361
4 changed files with 15 additions and 5 deletions
|
|
@ -42,10 +42,11 @@ download = (link, name = "") => {
|
|||
}
|
||||
},
|
||||
|
||||
downloadZip = (hashes, onError, fTrigger, folder) => {
|
||||
downloadZip = (name, hashes, onError, fTrigger, folder) => {
|
||||
if (hashes.length) {
|
||||
let params = {
|
||||
target: 'zip',
|
||||
filename: name,
|
||||
hashes: hashes
|
||||
};
|
||||
if (!onError) {
|
||||
|
|
|
|||
|
|
@ -363,13 +363,19 @@ export class MailMessageList extends AbstractViewRight {
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download selected messages
|
||||
*/
|
||||
downloadZipCommand() {
|
||||
let hashes = []/*, uids = []*/;
|
||||
// MessagelistUserStore.forEach(message => message.checked() && uids.push(message.uid));
|
||||
MessagelistUserStore.forEach(message => message.checked() && hashes.push(message.requestHash));
|
||||
downloadZip(hashes, null, null, MessagelistUserStore().folder);
|
||||
downloadZip(null, hashes, null, null, MessagelistUserStore().folder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download attachments of selected messages
|
||||
*/
|
||||
downloadAttachCommand() {
|
||||
let hashes = [];
|
||||
MessagelistUserStore.forEach(message => {
|
||||
|
|
@ -381,7 +387,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
});
|
||||
}
|
||||
});
|
||||
downloadZip(hashes);
|
||||
downloadZip(null, hashes);
|
||||
}
|
||||
|
||||
deleteWithoutMoveCommand() {
|
||||
|
|
|
|||
|
|
@ -469,7 +469,9 @@ export class MailMessageView extends AbstractViewRight {
|
|||
const hashes = (currentMessage()?.attachments || [])
|
||||
.map(item => item?.checked() /*&& !item?.isLinked()*/ ? item.download : '')
|
||||
.filter(v => v);
|
||||
downloadZip(hashes,
|
||||
downloadZip(
|
||||
currentMessage().subject(),
|
||||
hashes,
|
||||
() => this.downloadAsZipError(true),
|
||||
this.downloadAsZipLoading
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue