Found more JSON properties to change into JavaScript camelCase

This commit is contained in:
the-djmaze 2023-01-26 10:41:55 +01:00
parent b9ef8ae2c9
commit 974350ebee
45 changed files with 361 additions and 412 deletions

View file

@ -13,11 +13,11 @@ import { doc,
} from 'Common/Globals';
import { arrayLength } from 'Common/Utils';
import { computedPaginatorHelper, showMessageComposer, populateMessageBody, download, moveAction } from 'Common/UtilsUser';
import { computedPaginatorHelper, showMessageComposer, populateMessageBody, downloadZip, moveAction } from 'Common/UtilsUser';
import { FileInfo } from 'Common/File';
import { isFullscreen, toggleFullscreen } from 'Common/Fullscreen';
import { mailBox, attachmentDownload } from 'Common/Links';
import { mailBox } from 'Common/Links';
import { Selector } from 'Common/Selector';
import { i18n } from 'Common/Translator';
@ -367,23 +367,7 @@ export class MailMessageList extends AbstractViewRight {
let hashes = []/*, uids = []*/;
// MessagelistUserStore.forEach(message => message.checked() && uids.push(message.uid));
MessagelistUserStore.forEach(message => message.checked() && hashes.push(message.requestHash));
if (hashes.length) {
Remote.post('AttachmentsActions', null, {
Do: 'Zip',
folder: MessagelistUserStore().folder,
// Uids: uids,
Hashes: hashes
})
.then(result => {
let hash = result?.Result?.fileHash;
if (hash) {
download(attachmentDownload(hash), hash+'.zip');
} else {
alert('Download failed');
}
})
.catch(() => alert('Download failed'));
}
downloadZip(hashes, null, null, MessagelistUserStore().folder);
}
downloadAttachCommand() {
@ -397,21 +381,7 @@ export class MailMessageList extends AbstractViewRight {
});
}
});
if (hashes.length) {
Remote.post('AttachmentsActions', null, {
Do: 'Zip',
Hashes: hashes
})
.then(result => {
let hash = result?.Result?.fileHash;
if (hash) {
download(attachmentDownload(hash), hash+'.zip');
} else {
alert('Download failed');
}
})
.catch(() => alert('Download failed'));
}
downloadZip(hashes);
}
deleteWithoutMoveCommand() {
@ -505,8 +475,8 @@ export class MailMessageList extends AbstractViewRight {
Remote.request('MessageSetSeenToAll', null, {
folder: sFolderFullName,
SetAction: 1,
ThreadUids: uids.join(',')
setAction: 1,
threadUids: uids.join(',')
});
MessagelistUserStore.reloadFlagsAndCachedMessage();

View file

@ -23,13 +23,12 @@ import {
} from 'Common/Globals';
import { arrayLength } from 'Common/Utils';
import { download, mailToHelper, showMessageComposer, moveAction } from 'Common/UtilsUser';
import { download, downloadZip, mailToHelper, showMessageComposer, moveAction } from 'Common/UtilsUser';
import { isFullscreen, exitFullscreen, toggleFullscreen } from 'Common/Fullscreen';
import { SMAudio } from 'Common/Audio';
import { i18n } from 'Common/Translator';
import { attachmentDownload } from 'Common/Links';
import { MessageFlagsCache } from 'Common/Cache';
@ -486,21 +485,10 @@ export class MailMessageView extends AbstractViewRight {
const hashes = (currentMessage()?.attachments || [])
.map(item => item?.checked() /*&& !item?.isLinked()*/ ? item.download : '')
.filter(v => v);
if (hashes.length) {
Remote.post('AttachmentsActions', this.downloadAsZipLoading, {
Do: 'Zip',
Hashes: hashes
})
.then(result => {
let hash = result?.Result?.fileHash;
if (hash) {
download(attachmentDownload(hash), hash+'.zip');
} else {
this.downloadAsZipError(true);
}
})
.catch(() => this.downloadAsZipError(true));
}
downloadZip(hashes,
() => this.downloadAsZipError(true),
this.downloadAsZipLoading
);
}
/**