mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Found more JSON properties to change into JavaScript camelCase
This commit is contained in:
parent
b9ef8ae2c9
commit
974350ebee
45 changed files with 361 additions and 412 deletions
|
|
@ -12,6 +12,7 @@ import { SettingsUserStore } from 'Stores/User/Settings';
|
|||
import * as Local from 'Storage/Client';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
import { attachmentDownload } from 'Common/Links';
|
||||
|
||||
export const
|
||||
|
||||
|
|
@ -42,6 +43,28 @@ download = (link, name = "") => {
|
|||
}
|
||||
},
|
||||
|
||||
downloadZip = (hashes, onError, fTrigger, folder) => {
|
||||
if (hashes.length) {
|
||||
let params = {
|
||||
target: 'zip',
|
||||
hashes: hashes
|
||||
};
|
||||
if (!onError) {
|
||||
onError = () => alert('Download failed');
|
||||
}
|
||||
if (folder) {
|
||||
params.folder = folder;
|
||||
// params.uids = uids;
|
||||
}
|
||||
Remote.post('AttachmentsActions', fTrigger || null, params)
|
||||
.then(result => {
|
||||
let hash = result?.Result?.fileHash;
|
||||
hash ? download(attachmentDownload(hash), hash+'.zip') : onError();
|
||||
})
|
||||
.catch(onError);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns {function}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue