mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Converted *Ajax into *Fetch (because we use the Fetch API, not jQuery.ajax)
This commit is contained in:
parent
bb4d66d6d2
commit
29cf711a6a
52 changed files with 399 additions and 540 deletions
27
README.md
27
README.md
|
|
@ -85,26 +85,27 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|
||||||
* Removed opentip (use CSS)
|
* Removed opentip (use CSS)
|
||||||
* Removed non-community (aka Prem/Premium/License) code
|
* Removed non-community (aka Prem/Premium/License) code
|
||||||
* Modified Jua.js to be without jQuery
|
* Modified Jua.js to be without jQuery
|
||||||
|
* Replaced *Ajax with *Fetch classes because we use the Fetch API, not jQuery.ajax
|
||||||
|
|
||||||
|js/* |1.14.0 |native |
|
|js/* |1.14.0 |native |
|
||||||
|----------- |--------: |--------: |
|
|----------- |--------: |--------: |
|
||||||
|admin.js |2.130.942 | 936.773 |
|
|admin.js |2.130.942 | 941.273 |
|
||||||
|app.js |4.184.455 |2.554.276 |
|
|app.js |4.184.455 |2.533.271 |
|
||||||
|boot.js | 671.522 | 5.834 |
|
|boot.js | 671.522 | 5.777 |
|
||||||
|libs.js | 647.614 | 327.282 |
|
|libs.js | 647.614 | 327.257 |
|
||||||
|polyfills.js | 325.834 | 0 |
|
|polyfills.js | 325.834 | 0 |
|
||||||
|TOTAL |7.960.367 |3.824.165 |
|
|TOTAL |7.960.367 |3.807.578 |
|
||||||
|
|
||||||
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
||||||
|--------------- |--------: |--------: |--------: |--------: |--------: |
|
|--------------- |--------: |--------: |--------: |--------: |--------: |
|
||||||
|admin.min.js | 252.147 | 128.449 | 73.657 | 37.486 | 32.167 |
|
|admin.min.js | 252.147 | 128.671 | 73.657 | 37.600 | 32.254 |
|
||||||
|app.min.js | 511.202 | 348.973 |140.462 | 91.692 | 73.600 |
|
|app.min.js | 511.202 | 346.350 |140.462 | 90.770 | 73.272 |
|
||||||
|boot.min.js | 66.007 | 3.166 | 22.567 | 1.571 | 1.345 |
|
|boot.min.js | 66.007 | 3.101 | 22.567 | 1.576 | 1.346 |
|
||||||
|libs.min.js | 572.545 | 304.025 |176.720 | 94.879 | 83.565 |
|
|libs.min.js | 572.545 | 304.000 |176.720 | 94.870 | 83.524 |
|
||||||
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 |
|
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 |
|
||||||
|TOTAL |1.434.353 | 784.938 |424.718 |225.628 |190.677 |
|
|TOTAL |1.434.353 | 782.122 |424.718 |224.816 |190.396 |
|
||||||
|
|
||||||
649.415 bytes (199.090 gzip) is not much, but it feels faster.
|
652.231 bytes (199.902 gzip) is not much, but it feels faster.
|
||||||
|
|
||||||
### CSS changes
|
### CSS changes
|
||||||
|
|
||||||
|
|
@ -129,8 +130,8 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|
||||||
|
|
||||||
|css/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
|css/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|
||||||
|-------------- |-------: |-------: |------: |------: |------: |
|
|-------------- |-------: |-------: |------: |------: |------: |
|
||||||
|app.css | 340.334 | 253.711 | 46,959 | 36.587 | 30.802 |
|
|app.css | 340.334 | 253.691 | 46,959 | 36.574 | 30.777 |
|
||||||
|app.min.css | 274.791 | 207.227 | 39.618 | 31.993 | 27.160 |
|
|app.min.css | 274.791 | 207.298 | 39.618 | 32.001 | 27.155 |
|
||||||
|boot.css | | 2.538 | | 837 | 668 |
|
|boot.css | | 2.538 | | 837 | 668 |
|
||||||
|boot.min.css | | 2.055 | | 732 | 560 |
|
|boot.min.css | | 2.055 | | 732 | 560 |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import CapaStore from 'Stores/Admin/Capa';
|
||||||
import DomainStore from 'Stores/Admin/Domain';
|
import DomainStore from 'Stores/Admin/Domain';
|
||||||
import PluginStore from 'Stores/Admin/Plugin';
|
import PluginStore from 'Stores/Admin/Plugin';
|
||||||
import PackageStore from 'Stores/Admin/Package';
|
import PackageStore from 'Stores/Admin/Package';
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
|
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
|
||||||
import { LoginAdminScreen } from 'Screen/Admin/Login';
|
import { LoginAdminScreen } from 'Screen/Admin/Login';
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,7 @@ import QuotaStore from 'Stores/User/Quota';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
import Promises from 'Promises/User/Ajax';
|
|
||||||
|
|
||||||
import { EmailModel } from 'Model/Email';
|
import { EmailModel } from 'Model/Email';
|
||||||
import { AccountModel } from 'Model/Account';
|
import { AccountModel } from 'Model/Account';
|
||||||
|
|
@ -382,7 +381,7 @@ class AppUser extends AbstractApp {
|
||||||
* @param {Function=} callback = null
|
* @param {Function=} callback = null
|
||||||
*/
|
*/
|
||||||
foldersReload(callback = null) {
|
foldersReload(callback = null) {
|
||||||
const prom = Promises.foldersReload(FolderStore.foldersLoading);
|
const prom = Remote.foldersReload(FolderStore.foldersLoading);
|
||||||
if (callback) {
|
if (callback) {
|
||||||
prom
|
prom
|
||||||
.then((value) => !!value)
|
.then((value) => !!value)
|
||||||
|
|
@ -398,16 +397,16 @@ class AppUser extends AbstractApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
foldersPromisesActionHelper(promise, errorDefCode) {
|
foldersPromisesActionHelper(promise, errorDefCode) {
|
||||||
Promises.abort('Folders')
|
Remote.abort('Folders')
|
||||||
.fastResolve(true)
|
.fastResolve(true)
|
||||||
.then(() => promise)
|
.then(() => promise)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
Promises.foldersReloadWithTimeout(FolderStore.foldersLoading);
|
Remote.foldersReloadWithTimeout(FolderStore.foldersLoading);
|
||||||
},
|
},
|
||||||
(errorCode) => {
|
(errorCode) => {
|
||||||
FolderStore.folderList.error(getNotification(errorCode, '', errorDefCode));
|
FolderStore.folderList.error(getNotification(errorCode, '', errorDefCode));
|
||||||
Promises.foldersReloadWithTimeout(FolderStore.foldersLoading);
|
Remote.foldersReloadWithTimeout(FolderStore.foldersLoading);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,5 @@ dropdownVisibility.subscribe((value) => {
|
||||||
* @type {*}
|
* @type {*}
|
||||||
*/
|
*/
|
||||||
export const data = {
|
export const data = {
|
||||||
__APP__: null,
|
__APP__: null
|
||||||
iAjaxErrorCount: 0,
|
|
||||||
iTokenErrorCount: 0,
|
|
||||||
bUnload: false
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -156,14 +156,6 @@ export function change(email) {
|
||||||
return serverRequest('Change') + encodeURIComponent(email) + '/';
|
return serverRequest('Change') + encodeURIComponent(email) + '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} add
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
export function ajax(add) {
|
|
||||||
return serverRequest('Ajax') + add;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} requestHash
|
* @param {string} requestHash
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
|
|
||||||
|
|
@ -1,145 +0,0 @@
|
||||||
import { ajax } from 'Common/Links';
|
|
||||||
import { pInt, pString } from 'Common/Utils';
|
|
||||||
import { DEFAULT_AJAX_TIMEOUT, TOKEN_ERROR_LIMIT, AJAX_ERROR_LIMIT } from 'Common/Consts';
|
|
||||||
import { Notification } from 'Common/Enums';
|
|
||||||
import { data as GlobalsData } from 'Common/Globals';
|
|
||||||
|
|
||||||
import { AbstractBasicPromises } from 'Promises/AbstractBasic';
|
|
||||||
|
|
||||||
class AbstractAjaxPromises extends AbstractBasicPromises {
|
|
||||||
oRequests = {};
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
clear() {
|
|
||||||
this.oRequests = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
abort(sAction, bClearOnly) {
|
|
||||||
if (this.oRequests[sAction]) {
|
|
||||||
if (!bClearOnly && this.oRequests[sAction].abort) {
|
|
||||||
// this.oRequests[sAction].__aborted__ = true;
|
|
||||||
this.oRequests[sAction].abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.oRequests[sAction] = null;
|
|
||||||
delete this.oRequests[sAction];
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
ajaxRequest(action, isPost, timeOut, params, additionalGetString, fTrigger) {
|
|
||||||
|
|
||||||
additionalGetString = pString(additionalGetString);
|
|
||||||
|
|
||||||
let init = {};
|
|
||||||
|
|
||||||
this.setTrigger(fTrigger, true);
|
|
||||||
|
|
||||||
if (window.AbortController) {
|
|
||||||
this.abort(action);
|
|
||||||
const controller = new AbortController();
|
|
||||||
setTimeout(() => controller.abort(), pInt(timeOut, DEFAULT_AJAX_TIMEOUT));
|
|
||||||
init.signal = controller.signal;
|
|
||||||
this.oRequests[action] = controller;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rl.fetchJSON(ajax(additionalGetString), init, pInt(timeOut, DEFAULT_AJAX_TIMEOUT), isPost ? params : null)
|
|
||||||
.then(data => {
|
|
||||||
this.abort(action, true);
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
return Promise.reject(Notification.AjaxParse);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.UpdateToken) {
|
|
||||||
rl.hash.set();
|
|
||||||
rl.settings.set('AuthAccountHash', data.UpdateToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
let isCached = false, type = '';
|
|
||||||
if (data && data.Time) {
|
|
||||||
isCached = pInt(data.Time) > microtime() - start;
|
|
||||||
}
|
|
||||||
// backward capability
|
|
||||||
switch (true) {
|
|
||||||
case 'success' === textStatus && data && data.Result && action === data.Action:
|
|
||||||
type = StorageResultType.Success;
|
|
||||||
break;
|
|
||||||
case 'abort' === textStatus && (!data || !data.__aborted__):
|
|
||||||
type = StorageResultType.Abort;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
type = StorageResultType.Error;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
this.setTrigger(fTrigger, false);
|
|
||||||
|
|
||||||
if (!data.Result || action !== data.Action) {
|
|
||||||
if ([
|
|
||||||
Notification.AuthError,
|
|
||||||
Notification.AccessError,
|
|
||||||
Notification.ConnectionError,
|
|
||||||
Notification.DomainNotAllowed,
|
|
||||||
Notification.AccountNotAllowed,
|
|
||||||
Notification.MailServerError,
|
|
||||||
Notification.UnknownNotification,
|
|
||||||
Notification.UnknownError
|
|
||||||
].includes(data.ErrorCode)
|
|
||||||
) {
|
|
||||||
++GlobalsData.iAjaxErrorCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Notification.InvalidToken === data.ErrorCode) {
|
|
||||||
++GlobalsData.iTokenErrorCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TOKEN_ERROR_LIMIT < GlobalsData.iTokenErrorCount) {
|
|
||||||
rl.logoutReload();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.ClearAuth || data.Logout || AJAX_ERROR_LIMIT < GlobalsData.iAjaxErrorCount) {
|
|
||||||
if (GlobalsData.__APP__) {
|
|
||||||
rl.hash.clear();
|
|
||||||
|
|
||||||
if (!data.ClearAuth) {
|
|
||||||
rl.logoutReload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.reject(data.ErrorCode ? data.ErrorCode : Notification.AjaxFalse);
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}).catch(err => {
|
|
||||||
if (err.name == 'AbortError') { // handle abort()
|
|
||||||
return Promise.reject(Notification.AjaxAbort);
|
|
||||||
}
|
|
||||||
return Promise.reject(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getRequest(sAction, fTrigger, sAdditionalGetString, iTimeOut) {
|
|
||||||
sAdditionalGetString = undefined === sAdditionalGetString ? '' : pString(sAdditionalGetString);
|
|
||||||
sAdditionalGetString = sAction + '/' + sAdditionalGetString;
|
|
||||||
|
|
||||||
return this.ajaxRequest(sAction, false, iTimeOut, null, sAdditionalGetString, fTrigger);
|
|
||||||
}
|
|
||||||
|
|
||||||
postRequest(action, fTrigger, params, timeOut) {
|
|
||||||
params = params || {};
|
|
||||||
params.Action = action;
|
|
||||||
|
|
||||||
return this.ajaxRequest(action, true, timeOut, params, '', fTrigger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { AbstractAjaxPromises, AbstractAjaxPromises as default };
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
export class AbstractBasicPromises {
|
|
||||||
oPromisesStack = {};
|
|
||||||
|
|
||||||
func(fFunc) {
|
|
||||||
fFunc();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
fastResolve(mData) {
|
|
||||||
return Promise.resolve(mData);
|
|
||||||
}
|
|
||||||
|
|
||||||
fastReject(mData) {
|
|
||||||
return Promise.reject(mData);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTrigger(trigger, value) {
|
|
||||||
if (trigger) {
|
|
||||||
value = !!value;
|
|
||||||
(Array.isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => {
|
|
||||||
if (fTrigger) {
|
|
||||||
fTrigger(value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
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);
|
|
||||||
|
|
||||||
clearTimeout(this.foldersTimeout);
|
|
||||||
this.foldersTimeout = 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
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new UserAjaxUserPromises();
|
|
||||||
|
|
@ -8,14 +8,14 @@ import * as Local from 'Storage/Client';
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { FolderModel } from 'Model/Folder';
|
import { FolderModel } from 'Model/Folder';
|
||||||
import { AbstractBasicPromises } from 'Promises/AbstractBasic';
|
|
||||||
|
|
||||||
const Settings = rl.settings;
|
const Settings = rl.settings;
|
||||||
|
|
||||||
class PromisesUserPopulator extends AbstractBasicPromises {
|
class PromisesUserPopulator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} sFullNameHash
|
* @param {string} sFullNameHash
|
||||||
* @param {Array?} expandedFolders
|
* @param {Array?} expandedFolders
|
||||||
|
|
|
||||||
|
|
@ -1,216 +0,0 @@
|
||||||
import { TOKEN_ERROR_LIMIT, AJAX_ERROR_LIMIT, DEFAULT_AJAX_TIMEOUT } from 'Common/Consts';
|
|
||||||
import { StorageResultType, Notification } from 'Common/Enums';
|
|
||||||
import { pInt, pString } from 'Common/Utils';
|
|
||||||
import { data as GlobalsData } from 'Common/Globals';
|
|
||||||
import { ajax } from 'Common/Links';
|
|
||||||
|
|
||||||
|
|
||||||
class AbstractAjaxRemote {
|
|
||||||
constructor() {
|
|
||||||
this.oRequests = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
abort(sAction, bClearOnly) {
|
|
||||||
if (this.oRequests[sAction]) {
|
|
||||||
if (!bClearOnly && this.oRequests[sAction].abort) {
|
|
||||||
// this.oRequests[sAction].__aborted = true;
|
|
||||||
this.oRequests[sAction].abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.oRequests[sAction] = null;
|
|
||||||
delete this.oRequests[sAction];
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {?Function} fCallback
|
|
||||||
* @param {string} sRequestAction
|
|
||||||
* @param {string} sType
|
|
||||||
* @param {?AjaxJsonDefaultResponse} oData
|
|
||||||
* @param {boolean} bCached
|
|
||||||
* @param {*=} oRequestParameters
|
|
||||||
*/
|
|
||||||
defaultResponse(fCallback, sRequestAction, sType, oData, bCached, oRequestParameters) {
|
|
||||||
const fCall = () => {
|
|
||||||
if (StorageResultType.Success !== sType && GlobalsData.bUnload) {
|
|
||||||
sType = StorageResultType.Unload;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StorageResultType.Success === sType && oData && !oData.Result) {
|
|
||||||
const err = oData ? oData.ErrorCode : null;
|
|
||||||
if (
|
|
||||||
oData && [
|
|
||||||
Notification.AuthError,
|
|
||||||
Notification.AccessError,
|
|
||||||
Notification.ConnectionError,
|
|
||||||
Notification.DomainNotAllowed,
|
|
||||||
Notification.AccountNotAllowed,
|
|
||||||
Notification.MailServerError,
|
|
||||||
Notification.UnknownNotification,
|
|
||||||
Notification.UnknownError
|
|
||||||
].includes(err)
|
|
||||||
) {
|
|
||||||
++GlobalsData.iAjaxErrorCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oData && Notification.InvalidToken === err) {
|
|
||||||
++GlobalsData.iTokenErrorCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TOKEN_ERROR_LIMIT < GlobalsData.iTokenErrorCount) {
|
|
||||||
rl.logoutReload();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oData.ClearAuth || oData.Logout || AJAX_ERROR_LIMIT < GlobalsData.iAjaxErrorCount) {
|
|
||||||
if (GlobalsData.__APP__) {
|
|
||||||
rl.hash.clear();
|
|
||||||
|
|
||||||
if (!oData.ClearAuth) {
|
|
||||||
rl.logoutReload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (StorageResultType.Success === sType && oData && oData.Result) {
|
|
||||||
GlobalsData.iAjaxErrorCount = 0;
|
|
||||||
GlobalsData.iTokenErrorCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fCallback) {
|
|
||||||
fCallback(
|
|
||||||
sType,
|
|
||||||
StorageResultType.Success === sType ? oData : null,
|
|
||||||
bCached,
|
|
||||||
sRequestAction,
|
|
||||||
oRequestParameters
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
switch (sType) {
|
|
||||||
case 'success':
|
|
||||||
sType = StorageResultType.Success;
|
|
||||||
break;
|
|
||||||
case 'abort':
|
|
||||||
sType = StorageResultType.Abort;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sType = StorageResultType.Error;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StorageResultType.Error === sType) {
|
|
||||||
setTimeout(fCall, 300);
|
|
||||||
} else {
|
|
||||||
fCall();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {?Function} fResultCallback
|
|
||||||
* @param {Object} oParameters
|
|
||||||
* @param {?number=} iTimeOut = 20000
|
|
||||||
* @param {string=} sGetAdd = ''
|
|
||||||
* @param {Array=} aAbortActions = []
|
|
||||||
*/
|
|
||||||
ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) {
|
|
||||||
params = params || {};
|
|
||||||
const start = Date.now(),
|
|
||||||
action = params.Action || '';
|
|
||||||
|
|
||||||
if (action && abortActions) {
|
|
||||||
abortActions.forEach(actionToAbort => this.abort(actionToAbort));
|
|
||||||
}
|
|
||||||
|
|
||||||
let init = {};
|
|
||||||
|
|
||||||
if (window.AbortController) {
|
|
||||||
this.abort(action);
|
|
||||||
const controller = new AbortController();
|
|
||||||
if (iTimeOut) {
|
|
||||||
setTimeout(() => controller.abort(), iTimeOut);
|
|
||||||
}
|
|
||||||
init.signal = controller.signal;
|
|
||||||
this.oRequests[action] = controller;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rl.fetchJSON(ajax(sGetAdd), init, iTimeOut, sGetAdd ? null : params)
|
|
||||||
.then(oData => {
|
|
||||||
let cached = false;
|
|
||||||
if (oData && oData.Time) {
|
|
||||||
cached = pInt(oData.Time) > Date.now() - start;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oData && oData.UpdateToken) {
|
|
||||||
rl.hash.set();
|
|
||||||
rl.settings.set('AuthAccountHash', oData.UpdateToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
let sType = 'success';
|
|
||||||
if (action && this.oRequests[action]) {
|
|
||||||
if (this.oRequests[action].__aborted) {
|
|
||||||
sType = 'abort';
|
|
||||||
}
|
|
||||||
|
|
||||||
this.oRequests[action] = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.defaultResponse(fResultCallback, action, sType, oData, cached, params);
|
|
||||||
}).catch(err => {
|
|
||||||
if (err.name == 'AbortError') { // handle abort()
|
|
||||||
return Promise.reject(Notification.AjaxAbort);
|
|
||||||
}
|
|
||||||
return Promise.reject(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {?Function} fCallback
|
|
||||||
* @param {string} sAction
|
|
||||||
* @param {Object=} oParameters
|
|
||||||
* @param {?number=} iTimeout
|
|
||||||
* @param {string=} sGetAdd = ''
|
|
||||||
* @param {Array=} aAbortActions = []
|
|
||||||
*/
|
|
||||||
defaultRequest(fCallback, sAction, oParameters, iTimeout, sGetAdd, aAbortActions) {
|
|
||||||
oParameters = oParameters || {};
|
|
||||||
oParameters.Action = sAction;
|
|
||||||
|
|
||||||
sGetAdd = pString(sGetAdd);
|
|
||||||
|
|
||||||
return this.ajaxRequest(
|
|
||||||
fCallback,
|
|
||||||
oParameters,
|
|
||||||
undefined === iTimeout ? DEFAULT_AJAX_TIMEOUT : pInt(iTimeout),
|
|
||||||
sGetAdd,
|
|
||||||
aAbortActions
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {?Function} fCallback
|
|
||||||
*/
|
|
||||||
noop(fCallback) {
|
|
||||||
this.defaultRequest(fCallback, 'Noop');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {?Function} fCallback
|
|
||||||
*/
|
|
||||||
getPublicKey(fCallback) {
|
|
||||||
this.defaultRequest(fCallback, 'GetPublicKey');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {?Function} fCallback
|
|
||||||
* @param {string} sVersion
|
|
||||||
*/
|
|
||||||
jsVersion(fCallback, sVersion) {
|
|
||||||
this.defaultRequest(fCallback, 'Version', {
|
|
||||||
'Version': sVersion
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { AbstractAjaxRemote, AbstractAjaxRemote as default };
|
|
||||||
282
dev/Remote/AbstractFetch.js
Normal file
282
dev/Remote/AbstractFetch.js
Normal file
|
|
@ -0,0 +1,282 @@
|
||||||
|
import { TOKEN_ERROR_LIMIT, AJAX_ERROR_LIMIT, DEFAULT_AJAX_TIMEOUT } from 'Common/Consts';
|
||||||
|
import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
|
import { pInt, pString } from 'Common/Utils';
|
||||||
|
import { serverRequest } from 'Common/Links';
|
||||||
|
|
||||||
|
let iAjaxErrorCount = 0,
|
||||||
|
iTokenErrorCount = 0,
|
||||||
|
bUnload = false;
|
||||||
|
|
||||||
|
const getURL = (add = '') => serverRequest('Ajax') + add,
|
||||||
|
|
||||||
|
updateToken = data => {
|
||||||
|
if (data.UpdateToken) {
|
||||||
|
rl.hash.set();
|
||||||
|
rl.settings.set('AuthAccountHash', data.UpdateToken);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
checkResponseError = data => {
|
||||||
|
const err = data ? data.ErrorCode : null;
|
||||||
|
if ([
|
||||||
|
Notification.AuthError,
|
||||||
|
Notification.AccessError,
|
||||||
|
Notification.ConnectionError,
|
||||||
|
Notification.DomainNotAllowed,
|
||||||
|
Notification.AccountNotAllowed,
|
||||||
|
Notification.MailServerError,
|
||||||
|
Notification.UnknownNotification,
|
||||||
|
Notification.UnknownError
|
||||||
|
].includes(err)
|
||||||
|
) {
|
||||||
|
++iAjaxErrorCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Notification.InvalidToken === err) {
|
||||||
|
++iTokenErrorCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TOKEN_ERROR_LIMIT < iTokenErrorCount) {
|
||||||
|
rl.logoutReload();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.rl && (data.ClearAuth || data.Logout || AJAX_ERROR_LIMIT < iAjaxErrorCount)) {
|
||||||
|
rl.hash.clear();
|
||||||
|
|
||||||
|
if (!data.ClearAuth) {
|
||||||
|
rl.logoutReload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
oRequests = {};
|
||||||
|
|
||||||
|
addEventListener('unload', () => bUnload = true);
|
||||||
|
|
||||||
|
class AbstractFetchRemote
|
||||||
|
{
|
||||||
|
abort(sAction, bClearOnly) {
|
||||||
|
if (oRequests[sAction]) {
|
||||||
|
if (!bClearOnly && oRequests[sAction].abort) {
|
||||||
|
// oRequests[sAction].__aborted = true;
|
||||||
|
oRequests[sAction].abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
oRequests[sAction] = null;
|
||||||
|
delete oRequests[sAction];
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Function} fResultCallback
|
||||||
|
* @param {Object} oParameters
|
||||||
|
* @param {?number=} iTimeOut = 20000
|
||||||
|
* @param {string=} sGetAdd = ''
|
||||||
|
* @param {Array=} aAbortActions = []
|
||||||
|
*/
|
||||||
|
ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) {
|
||||||
|
params = params || {};
|
||||||
|
const start = Date.now(),
|
||||||
|
action = params.Action || '';
|
||||||
|
|
||||||
|
if (action && abortActions) {
|
||||||
|
abortActions.forEach(actionToAbort => this.abort(actionToAbort));
|
||||||
|
}
|
||||||
|
|
||||||
|
return rl.fetchJSON(getURL(sGetAdd), {
|
||||||
|
signal: this.createAbort(action, iTimeOut)
|
||||||
|
}, iTimeOut, sGetAdd ? null : params
|
||||||
|
).then(data => {
|
||||||
|
let cached = false;
|
||||||
|
if (data) {
|
||||||
|
if (data.Time) {
|
||||||
|
cached = pInt(data.Time) > Date.now() - start;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateToken(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
let sType = 'success';
|
||||||
|
if (action && oRequests[action]) {
|
||||||
|
if (oRequests[action].__aborted) {
|
||||||
|
sType = 'abort';
|
||||||
|
}
|
||||||
|
this.abort(action, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const fCall = () => {
|
||||||
|
if (StorageResultType.Success !== sType && bUnload) {
|
||||||
|
sType = StorageResultType.Unload;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StorageResultType.Success === sType && data && !data.Result) {
|
||||||
|
checkResponseError(data);
|
||||||
|
} else if (StorageResultType.Success === sType && data && data.Result) {
|
||||||
|
iAjaxErrorCount = iTokenErrorCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fResultCallback) {
|
||||||
|
fResultCallback(
|
||||||
|
sType,
|
||||||
|
StorageResultType.Success === sType ? data : null,
|
||||||
|
cached,
|
||||||
|
action,
|
||||||
|
params
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (sType) {
|
||||||
|
case 'success':
|
||||||
|
sType = StorageResultType.Success;
|
||||||
|
break;
|
||||||
|
case 'abort':
|
||||||
|
sType = StorageResultType.Abort;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sType = StorageResultType.Error;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StorageResultType.Error === sType) {
|
||||||
|
setTimeout(fCall, 300);
|
||||||
|
} else {
|
||||||
|
fCall();
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
if (err.name == 'AbortError') { // handle abort()
|
||||||
|
err = Notification.AjaxAbort;
|
||||||
|
}
|
||||||
|
return Promise.reject(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Function} fCallback
|
||||||
|
* @param {string} sAction
|
||||||
|
* @param {Object=} oParameters
|
||||||
|
* @param {?number=} iTimeout
|
||||||
|
* @param {string=} sGetAdd = ''
|
||||||
|
* @param {Array=} aAbortActions = []
|
||||||
|
*/
|
||||||
|
defaultRequest(fCallback, sAction, oParameters, iTimeout, sGetAdd, aAbortActions) {
|
||||||
|
oParameters = oParameters || {};
|
||||||
|
oParameters.Action = sAction;
|
||||||
|
|
||||||
|
return this.ajaxRequest(
|
||||||
|
fCallback,
|
||||||
|
oParameters,
|
||||||
|
undefined === iTimeout ? DEFAULT_AJAX_TIMEOUT : pInt(iTimeout),
|
||||||
|
pString(sGetAdd),
|
||||||
|
aAbortActions
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Function} fCallback
|
||||||
|
*/
|
||||||
|
noop(fCallback) {
|
||||||
|
this.defaultRequest(fCallback, 'Noop');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Function} fCallback
|
||||||
|
*/
|
||||||
|
getPublicKey(fCallback) {
|
||||||
|
this.defaultRequest(fCallback, 'GetPublicKey');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Function} fCallback
|
||||||
|
* @param {string} sVersion
|
||||||
|
*/
|
||||||
|
jsVersion(fCallback, sVersion) {
|
||||||
|
this.defaultRequest(fCallback, 'Version', {
|
||||||
|
'Version': sVersion
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
createAbort(action, timeout) {
|
||||||
|
if (window.AbortController) {
|
||||||
|
this.abort(action);
|
||||||
|
const controller = new AbortController();
|
||||||
|
if (timeout) {
|
||||||
|
setTimeout(() => controller.abort(), timeout);
|
||||||
|
}
|
||||||
|
oRequests[action] = controller;
|
||||||
|
return controller.signal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fastResolve(mData) {
|
||||||
|
return Promise.resolve(mData);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTrigger(trigger, value) {
|
||||||
|
if (trigger) {
|
||||||
|
value = !!value;
|
||||||
|
(Array.isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => {
|
||||||
|
if (fTrigger) {
|
||||||
|
fTrigger(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
postRequest(action, fTrigger, params, timeOut) {
|
||||||
|
params = params || {};
|
||||||
|
params.Action = action;
|
||||||
|
|
||||||
|
this.setTrigger(fTrigger, true);
|
||||||
|
|
||||||
|
return rl.fetchJSON(getURL(), {
|
||||||
|
signal: this.createAbort(action, pInt(timeOut, DEFAULT_AJAX_TIMEOUT))
|
||||||
|
}, pInt(timeOut, DEFAULT_AJAX_TIMEOUT), params
|
||||||
|
).then(data => {
|
||||||
|
this.abort(action, true);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return Promise.reject(Notification.AjaxParse);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateToken(data);
|
||||||
|
/*
|
||||||
|
let isCached = false, type = '';
|
||||||
|
if (data && data.Time) {
|
||||||
|
isCached = pInt(data.Time) > microtime() - start;
|
||||||
|
}
|
||||||
|
// backward capability
|
||||||
|
switch (true) {
|
||||||
|
case 'success' === textStatus && data && data.Result && action === data.Action:
|
||||||
|
type = StorageResultType.Success;
|
||||||
|
break;
|
||||||
|
case 'abort' === textStatus && (!data || !data.__aborted__):
|
||||||
|
type = StorageResultType.Abort;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = StorageResultType.Error;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
this.setTrigger(fTrigger, false);
|
||||||
|
|
||||||
|
if (!data.Result || action !== data.Action) {
|
||||||
|
checkResponseError(data);
|
||||||
|
const err = data ? data.ErrorCode : null;
|
||||||
|
return Promise.reject(err || Notification.AjaxFalse);
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}).catch(err => {
|
||||||
|
if (err.name == 'AbortError') { // handle abort()
|
||||||
|
return Promise.reject(Notification.AjaxAbort);
|
||||||
|
}
|
||||||
|
return Promise.reject(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { AbstractFetchRemote, AbstractFetchRemote as default };
|
||||||
|
|
@ -1,12 +1,6 @@
|
||||||
import { AbstractAjaxRemote } from 'Remote/AbstractAjax';
|
import { AbstractFetchRemote } from 'Remote/AbstractFetch';
|
||||||
|
|
||||||
class RemoteAdminAjax extends AbstractAjaxRemote {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.oRequests = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
class RemoteAdminFetch extends AbstractFetchRemote {
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {string} sLogin
|
* @param {string} sLogin
|
||||||
|
|
@ -271,4 +265,4 @@ class RemoteAdminAjax extends AbstractAjaxRemote {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new RemoteAdminAjax();
|
export default new RemoteAdminFetch();
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { pString, pInt } from 'Common/Utils';
|
import { pString, pInt } from 'Common/Utils';
|
||||||
|
import PromisesPopulator from 'Promises/User/Populator';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CONTACTS_SYNC_AJAX_TIMEOUT,
|
CONTACTS_SYNC_AJAX_TIMEOUT,
|
||||||
|
|
@ -23,7 +24,7 @@ import SettingsStore from 'Stores/User/Settings';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
import { AbstractAjaxRemote } from 'Remote/AbstractAjax';
|
import { AbstractFetchRemote } from 'Remote/AbstractFetch';
|
||||||
|
|
||||||
//const toUTF8 = window.TextEncoder
|
//const toUTF8 = window.TextEncoder
|
||||||
// ? text => String.fromCharCode(...new TextEncoder().encode(text))
|
// ? text => String.fromCharCode(...new TextEncoder().encode(text))
|
||||||
|
|
@ -33,12 +34,7 @@ const urlsafeArray = array => btoa(unescape(encodeURIComponent(array.join('\x00'
|
||||||
.replace('/', '_')
|
.replace('/', '_')
|
||||||
.replace('=', '');
|
.replace('=', '');
|
||||||
|
|
||||||
class RemoteUserAjax extends AbstractAjaxRemote {
|
class RemoteUserFetch extends AbstractFetchRemote {
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this.oRequests = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
|
|
@ -775,6 +771,50 @@ class RemoteUserAjax extends AbstractAjaxRemote {
|
||||||
clearUserBackground(fCallback) {
|
clearUserBackground(fCallback) {
|
||||||
this.defaultRequest(fCallback, 'ClearUserBackground');
|
this.defaultRequest(fCallback, 'ClearUserBackground');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
clearTimeout(this.foldersTimeout);
|
||||||
|
this.foldersTimeout = 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
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new RemoteUserAjax();
|
export default new RemoteUserFetch();
|
||||||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
||||||
|
|
||||||
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
class BrandingAdminSettings {
|
class BrandingAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { settingsSaveHelperSimpleFunction, defautOptionsAfterRender } from 'Comm
|
||||||
|
|
||||||
import { SaveSettingsStep, StorageResultType } from 'Common/Enums';
|
import { SaveSettingsStep, StorageResultType } from 'Common/Enums';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
import { command } from 'Knoin/Knoin';
|
import { command } from 'Knoin/Knoin';
|
||||||
|
|
||||||
const settingsGet = rl.settings.get;
|
const settingsGet = rl.settings.get;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { StorageResultType } from 'Common/Enums';
|
||||||
import { showScreenPopup } from 'Knoin/Knoin';
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import DomainStore from 'Stores/Admin/Domain';
|
import DomainStore from 'Stores/Admin/Domain';
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import { reload as translatorReload } from 'Common/Translator';
|
||||||
|
|
||||||
import { showScreenPopup } from 'Knoin/Knoin';
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import ThemeStore from 'Stores/Theme';
|
import ThemeStore from 'Stores/Theme';
|
||||||
import LanguageStore from 'Stores/Language';
|
import LanguageStore from 'Stores/Language';
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
|
||||||
|
|
||||||
import AppStore from 'Stores/Admin/App';
|
import AppStore from 'Stores/Admin/App';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
class LoginAdminSettings {
|
class LoginAdminSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import PackageStore from 'Stores/Admin/Package';
|
import PackageStore from 'Stores/Admin/Package';
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import PluginStore from 'Stores/Admin/Plugin';
|
import PluginStore from 'Stores/Admin/Plugin';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { StorageResultType } from 'Common/Enums';
|
||||||
import AppAdminStore from 'Stores/Admin/App';
|
import AppAdminStore from 'Stores/Admin/App';
|
||||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { command } from 'Knoin/Knoin';
|
import { command } from 'Knoin/Knoin';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { root } from 'Common/Links';
|
||||||
|
|
||||||
import AccountStore from 'Stores/User/Account';
|
import AccountStore from 'Stores/User/Account';
|
||||||
import IdentityStore from 'Stores/User/Identity';
|
import IdentityStore from 'Stores/User/Identity';
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
||||||
|
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import ContactStore from 'Stores/User/Contact';
|
import ContactStore from 'Stores/User/Contact';
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
class ContactsUserSettings {
|
class ContactsUserSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import FilterStore from 'Stores/User/Filter';
|
import FilterStore from 'Stores/User/Filter';
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { FilterModel } from 'Model/Filter';
|
import { FilterModel } from 'Model/Filter';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
|
|
||||||
import Promises from 'Promises/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
import Remote from 'Remote/User/Ajax';
|
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
@ -46,7 +45,7 @@ class FoldersUserSettings {
|
||||||
Local.set(ClientSideKeyName.FoldersLashHash, '');
|
Local.set(ClientSideKeyName.FoldersLashHash, '');
|
||||||
|
|
||||||
getApp().foldersPromisesActionHelper(
|
getApp().foldersPromisesActionHelper(
|
||||||
Promises.folderRename(folder.fullNameRaw, nameToEdit, FolderStore.foldersRenaming),
|
Remote.folderRename(folder.fullNameRaw, nameToEdit, FolderStore.foldersRenaming),
|
||||||
Notification.CantRenameFolder
|
Notification.CantRenameFolder
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -109,7 +108,7 @@ class FoldersUserSettings {
|
||||||
FolderStore.folderList.remove(fRemoveFolder);
|
FolderStore.folderList.remove(fRemoveFolder);
|
||||||
|
|
||||||
getApp().foldersPromisesActionHelper(
|
getApp().foldersPromisesActionHelper(
|
||||||
Promises.folderDelete(folderToRemove.fullNameRaw, FolderStore.foldersDeleting),
|
Remote.folderDelete(folderToRemove.fullNameRaw, FolderStore.foldersDeleting),
|
||||||
Notification.CantDeleteFolder
|
Notification.CantDeleteFolder
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import IdentityStore from 'Stores/User/Identity';
|
||||||
import NotificationStore from 'Stores/User/Notification';
|
import NotificationStore from 'Stores/User/Notification';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
class GeneralUserSettings {
|
class GeneralUserSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { delegateRunOnDestroy } from 'Common/Utils';
|
||||||
import PgpStore from 'Stores/User/Pgp';
|
import PgpStore from 'Stores/User/Pgp';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
||||||
import SettinsStore from 'Stores/User/Settings';
|
import SettinsStore from 'Stores/User/Settings';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
class SecurityUserSettings {
|
class SecurityUserSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import TemplateStore from 'Stores/User/Template';
|
import TemplateStore from 'Stores/User/Template';
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import ThemeStore from 'Stores/Theme';
|
import ThemeStore from 'Stores/Theme';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
class ThemesUserSettings {
|
class ThemesUserSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ import NotificationStore from 'Stores/User/Notification';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
const
|
const
|
||||||
hcont = Element.fromHTML('<div area="hidden" style="position:absolute;left:-5000px"></div>'),
|
hcont = Element.fromHTML('<div area="hidden" style="position:absolute;left:-5000px"></div>'),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
// import Remote from 'Remote/User/Ajax';
|
// import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
class TemplateUserStore {
|
class TemplateUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 0;
|
border: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
color: #000;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
||||||
import { StorageResultType, Notification } from 'Common/Enums';
|
import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { view, command, ViewType, routeOff, routeReload } from 'Knoin/Knoin';
|
import { view, command, ViewType, routeOff, routeReload } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import DomainStore from 'Stores/Admin/Domain';
|
import DomainStore from 'Stores/Admin/Domain';
|
||||||
import PluginStore from 'Stores/Admin/Plugin';
|
import PluginStore from 'Stores/Admin/Plugin';
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
||||||
import { StorageResultType, Notification } from 'Common/Enums';
|
import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import FolderStore from 'Stores/User/Folder';
|
||||||
import PgpStore from 'Stores/User/Pgp';
|
import PgpStore from 'Stores/User/Pgp';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
|
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import { i18n, getNotification } from 'Common/Translator';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
import ContactStore from 'Stores/User/Contact';
|
import ContactStore from 'Stores/User/Contact';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { EmailModel } from 'Model/Email';
|
import { EmailModel } from 'Model/Email';
|
||||||
import { ContactModel } from 'Model/Contact';
|
import { ContactModel } from 'Model/Contact';
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import DomainStore from 'Stores/Admin/Domain';
|
import DomainStore from 'Stores/Admin/Domain';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/Admin';
|
import { getApp } from 'Helper/Apps/Admin';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { setFolderHash } from 'Common/Cache';
|
||||||
|
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { defautOptionsAfterRender, folderListOptionsBuilder } from 'Common/Utils
|
||||||
|
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
|
|
||||||
import Promises from 'Promises/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ class FolderCreateView extends AbstractViewNext {
|
||||||
}
|
}
|
||||||
|
|
||||||
getApp().foldersPromisesActionHelper(
|
getApp().foldersPromisesActionHelper(
|
||||||
Promises.folderCreate(this.folderName(), parentFolderName, FolderStore.foldersCreating),
|
Remote.folderCreate(this.folderName(), parentFolderName, FolderStore.foldersCreating),
|
||||||
Notification.CantCreateFolder
|
Notification.CantCreateFolder
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { popup } from 'Knoin/Knoin';
|
import { popup } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { bMobileDevice } from 'Common/Globals';
|
||||||
import { fakeMd5 } from 'Common/Utils';
|
import { fakeMd5 } from 'Common/Utils';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
||||||
import { KeyState, StorageResultType, Notification } from 'Common/Enums';
|
import { KeyState, StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification, i18n } from 'Common/Translator';
|
import { getNotification, i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Ajax';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { popup, command, isPopupVisible, showScreenPopup } from 'Knoin/Knoin';
|
import { popup, command, isPopupVisible, showScreenPopup } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { getNotification } from 'Common/Translator';
|
import { getNotification } from 'Common/Translator';
|
||||||
import { HtmlEditor } from 'Common/HtmlEditor';
|
import { HtmlEditor } from 'Common/HtmlEditor';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Capa, StorageResultType } from 'Common/Enums';
|
||||||
import { pString } from 'Common/Utils';
|
import { pString } from 'Common/Utils';
|
||||||
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
||||||
import { StorageResultType } from 'Common/Enums';
|
import { StorageResultType } from 'Common/Enums';
|
||||||
import { bMobileDevice } from 'Common/Globals';
|
import { bMobileDevice } from 'Common/Globals';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { popup, command } from 'Knoin/Knoin';
|
import { popup, command } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import LanguageStore from 'Stores/Language';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { view, command, ViewType, routeOff, showScreenPopup, routeReload } from 'Knoin/Knoin';
|
import { view, command, ViewType, routeOff, showScreenPopup, routeReload } from 'Knoin/Knoin';
|
||||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ import SettingsStore from 'Stores/User/Settings';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ import MessageStore from 'Stores/User/Message';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Ajax';
|
import Remote from 'Remote/User/Fetch';
|
||||||
import Promises from 'Promises/User/Ajax';
|
|
||||||
|
|
||||||
import { getApp } from 'Helper/Apps/User';
|
import { getApp } from 'Helper/Apps/User';
|
||||||
|
|
||||||
|
|
@ -781,7 +780,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
||||||
downloadAsZip() {
|
downloadAsZip() {
|
||||||
const hashes = this.getAttachmentsHashes();
|
const hashes = this.getAttachmentsHashes();
|
||||||
if (hashes.length) {
|
if (hashes.length) {
|
||||||
Promises.attachmentsActions('Zip', hashes, this.downloadAsZipLoading)
|
Remote.attachmentsActions('Zip', hashes, this.downloadAsZipLoading)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result && result.Result && result.Result.Files && result.Result.Files[0] && result.Result.Files[0].Hash) {
|
if (result && result.Result && result.Result.Files && result.Result.Files[0] && result.Result.Files[0].Hash) {
|
||||||
getApp().download(attachmentDownload(result.Result.Files[0].Hash));
|
getApp().download(attachmentDownload(result.Result.Files[0].Hash));
|
||||||
|
|
|
||||||
1
dev/bootstrap.js
vendored
1
dev/bootstrap.js
vendored
|
|
@ -28,7 +28,6 @@ export default (App) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
addEventListener('unload', () => GlobalsData.bUnload = true);
|
|
||||||
|
|
||||||
addEventListener('click', ()=>rl.Dropdowns.detectVisibility());
|
addEventListener('click', ()=>rl.Dropdowns.detectVisibility());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue