mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
new Date() syntax & units on var name
This commit is contained in:
parent
0df0935b9c
commit
31b083d93e
1 changed files with 5 additions and 5 deletions
|
@ -31,8 +31,8 @@ class UserActivity {
|
|||
start() {
|
||||
document.onmousemove = this._onUserActivity.bind(this);
|
||||
document.onkeypress = this._onUserActivity.bind(this);
|
||||
this.lastActivityAt = (new Date).getTime();
|
||||
this.lastDispatchAt = 0;
|
||||
this.lastActivityAtTs = new Date().getTime();
|
||||
this.lastDispatchAtTs = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,9 +44,9 @@ class UserActivity {
|
|||
}
|
||||
|
||||
_onUserActivity() {
|
||||
this.lastActivityAt = (new Date).getTime();
|
||||
if (this.lastDispatchAt < this.lastActivityAt - MIN_DISPATCH_INTERVAL) {
|
||||
this.lastDispatchAt = this.lastActivityAt;
|
||||
this.lastActivityAtTs = (new Date).getTime();
|
||||
if (this.lastDispatchAtTs < this.lastActivityAtTs - MIN_DISPATCH_INTERVAL) {
|
||||
this.lastDispatchAtTs = this.lastActivityAtTs;
|
||||
dis.dispatch({
|
||||
action: 'user_activity'
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue