mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
eslint (additional rules)
This commit is contained in:
parent
77a1d3f3df
commit
8e8a041032
150 changed files with 21911 additions and 23106 deletions
|
|
@ -45,35 +45,43 @@ const timestamp = () => window.Math.round((new window.Date()).getTime() / 1000);
|
|||
const setTimestamp = () => __set(TIME_KEY, timestamp());
|
||||
|
||||
const getTimestamp = () => {
|
||||
let time = __get(TIME_KEY, 0);
|
||||
const time = __get(TIME_KEY, 0);
|
||||
return time ? (window.parseInt(time, 10) || 0) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getHash()
|
||||
{
|
||||
return __get(STORAGE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
export function setHash()
|
||||
{
|
||||
const
|
||||
key = 'AuthAccountHash',
|
||||
appData = window.__rlah_data()
|
||||
;
|
||||
appData = window.__rlah_data();
|
||||
|
||||
__set(STORAGE_KEY, appData && appData[key] ? appData[key] : '');
|
||||
setTimestamp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
export function clearHash()
|
||||
{
|
||||
__set(STORAGE_KEY, '');
|
||||
setTimestamp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function checkTimestamp()
|
||||
{
|
||||
if (timestamp() > getTimestamp() + 1000 * 60 * 60) // 60m
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue