mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
new Date().getTime() to Date.now()
This commit is contained in:
parent
7670d2073d
commit
1b811428e7
3 changed files with 5 additions and 5 deletions
|
|
@ -255,7 +255,7 @@ export function getUploadErrorDescByCode(code) {
|
||||||
* @param {string} language
|
* @param {string} language
|
||||||
*/
|
*/
|
||||||
export function reload(admin, language) {
|
export function reload(admin, language) {
|
||||||
const start = new Date().getTime();
|
const start = Date.now();
|
||||||
|
|
||||||
$htmlCL.add('rl-changing-language');
|
$htmlCL.add('rl-changing-language');
|
||||||
|
|
||||||
|
|
@ -288,7 +288,7 @@ export function reload(admin, language) {
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
},
|
},
|
||||||
500 < (new Date().getTime()) - start ? 1 : 500
|
500 < Date.now() - start ? 1 : 500
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ class AbstractAjaxRemote {
|
||||||
ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) {
|
ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) {
|
||||||
params = params || {};
|
params = params || {};
|
||||||
const isPost = !sGetAdd,
|
const isPost = !sGetAdd,
|
||||||
start = new Date().getTime(),
|
start = Date.now(),
|
||||||
action = params.Action || '';
|
action = params.Action || '';
|
||||||
|
|
||||||
if (action && abortActions) {
|
if (action && abortActions) {
|
||||||
|
|
@ -181,7 +181,7 @@ class AbstractAjaxRemote {
|
||||||
.then(oData => {
|
.then(oData => {
|
||||||
let cached = false;
|
let cached = false;
|
||||||
if (oData && oData.Time) {
|
if (oData && oData.Time) {
|
||||||
cached = pInt(oData.Time) > new Date().getTime() - start;
|
cached = pInt(oData.Time) > Date.now() - start;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oData && oData.UpdateToken) {
|
if (oData && oData.UpdateToken) {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ const __set = (key, value) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const timestamp = () => Math.round(new Date().getTime() / 1000);
|
const timestamp = () => Math.round(Date.now() / 1000);
|
||||||
|
|
||||||
const setTimestamp = () => __set(TIME_KEY, timestamp());
|
const setTimestamp = () => __set(TIME_KEY, timestamp());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue