Time limit improvements

This commit is contained in:
RainLoop Team 2016-05-22 15:27:50 +03:00
parent d2c16381e2
commit 338f18d2af
3 changed files with 38 additions and 22 deletions

View file

@ -54,21 +54,21 @@ class RainLoopStorage
return window.Math.round((new Date()).getTime() / 1000);
}
init() {
checkTimestamp() {
const
six = 1000 * 60 * 6, // 6m
now = this.timestamp()
;
if (now > this.getTimestamp() + six * 10)
if (this.timestamp() > this.getTimestamp() + 1000 * 60 * 60) // 60m
{
this.clearHash();
return true;
}
return false;
}
init() {
window.setInterval(() => {
this.setTimestamp();
}, six);
}, 1000 * 60); // 1m
}
getHash() {