mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-10 00:38:04 +08:00
e5af98b04b
Move e2e tests Code refactoring
64 lines
1.5 KiB
JavaScript
64 lines
1.5 KiB
JavaScript
|
|
import window from 'window';
|
|
|
|
import PromisesPopulator from 'Promises/User/Populator';
|
|
import {AbstractAjaxPromises} from 'Promises/AbstractAjax';
|
|
|
|
class UserAjaxUserPromises extends AbstractAjaxPromises
|
|
{
|
|
constructor() {
|
|
super();
|
|
|
|
this.foldersTimeout = 0;
|
|
}
|
|
|
|
foldersReload(fTrigger) {
|
|
return this.abort('Folders').postRequest('Folders', fTrigger).then((data) => {
|
|
PromisesPopulator.foldersList(data.Result);
|
|
PromisesPopulator.foldersAdditionalParameters(data.Result);
|
|
return true;
|
|
});
|
|
}
|
|
|
|
foldersReloadWithTimeout(fTrigger) {
|
|
this.setTrigger(fTrigger, true);
|
|
|
|
window.clearTimeout(this.foldersTimeout);
|
|
this.foldersTimeout = window.setTimeout(() => {
|
|
this.foldersReload(fTrigger);
|
|
}, 500);
|
|
}
|
|
|
|
folderDelete(sFolderFullNameRaw, fTrigger) {
|
|
return this.postRequest('FolderDelete', fTrigger, {
|
|
'Folder': sFolderFullNameRaw
|
|
});
|
|
}
|
|
|
|
folderCreate(sNewFolderName, sParentName, fTrigger) {
|
|
return this.postRequest('FolderCreate', fTrigger, {
|
|
'Folder': sNewFolderName,
|
|
'Parent': sParentName
|
|
});
|
|
}
|
|
|
|
folderRename(sPrevFolderFullNameRaw, sNewFolderName, fTrigger) {
|
|
return this.postRequest('FolderRename', fTrigger, {
|
|
'Folder': sPrevFolderFullNameRaw,
|
|
'NewFolderName': sNewFolderName
|
|
});
|
|
}
|
|
|
|
attachmentsActions(sAction, aHashes, fTrigger) {
|
|
return this.postRequest('AttachmentsActions', fTrigger, {
|
|
'Do': sAction,
|
|
'Hashes': aHashes
|
|
});
|
|
}
|
|
|
|
welcomeClose() {
|
|
return this.postRequest('WelcomeClose');
|
|
}
|
|
}
|
|
|
|
export default new UserAjaxUserPromises();
|