This commit is contained in:
the-djmaze 2023-02-25 14:16:04 +01:00
parent 0144be49bf
commit d8b05ee361
4 changed files with 15 additions and 5 deletions

View file

@ -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) {

View file

@ -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() {

View file

@ -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
);