eslint (additional rules)

This commit is contained in:
RainLoop Team 2016-06-30 03:02:45 +03:00
parent 77a1d3f3df
commit 8e8a041032
150 changed files with 21911 additions and 23106 deletions

View file

@ -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