mirror of https://github.com/vector-im/riot-web
Rename more things
parent
08e21ff5d4
commit
374be0b3b4
|
@ -42,8 +42,8 @@ export default class UserActivity {
|
||||||
this._window = windowObj;
|
this._window = windowObj;
|
||||||
this._document = documentObj;
|
this._document = documentObj;
|
||||||
|
|
||||||
this._attachedTimersActive = [];
|
this._attachedActiveNowTimers = [];
|
||||||
this._attachedTimersPassive = [];
|
this._attachedActiveRecentlyTimers = [];
|
||||||
this._activeNowTimeout = new Timer(CURRENTLY_ACTIVE_THRESHOLD_MS);
|
this._activeNowTimeout = new Timer(CURRENTLY_ACTIVE_THRESHOLD_MS);
|
||||||
this._activeRecentlyTimeout = new Timer(RECENTLY_ACTIVE_THRESHOLD_MS);
|
this._activeRecentlyTimeout = new Timer(RECENTLY_ACTIVE_THRESHOLD_MS);
|
||||||
this._onUserActivity = this._onUserActivity.bind(this);
|
this._onUserActivity = this._onUserActivity.bind(this);
|
||||||
|
@ -70,7 +70,7 @@ export default class UserActivity {
|
||||||
* @param {Timer} timer the timer to use
|
* @param {Timer} timer the timer to use
|
||||||
*/
|
*/
|
||||||
timeWhileActiveNow(timer) {
|
timeWhileActiveNow(timer) {
|
||||||
this._timeWhile(timer, this._attachedTimersActive);
|
this._timeWhile(timer, this._attachedActiveNowTimers);
|
||||||
if (this.userActiveNow()) {
|
if (this.userActiveNow()) {
|
||||||
timer.start();
|
timer.start();
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ export default class UserActivity {
|
||||||
* @param {Timer} timer the timer to use
|
* @param {Timer} timer the timer to use
|
||||||
*/
|
*/
|
||||||
timeWhileActiveRecently(timer) {
|
timeWhileActiveRecently(timer) {
|
||||||
this._timeWhile(timer, this._attachedTimersPassive);
|
this._timeWhile(timer, this._attachedActiveRecentlyTimers);
|
||||||
if (this.userActiveRecently()) {
|
if (this.userActiveRecently()) {
|
||||||
timer.start();
|
timer.start();
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ export default class UserActivity {
|
||||||
this._activeNowTimeout.start();
|
this._activeNowTimeout.start();
|
||||||
dis.dispatch({action: 'user_activity_start'});
|
dis.dispatch({action: 'user_activity_start'});
|
||||||
|
|
||||||
this._runTimersUntilTimeout(this._attachedTimersActive, this._activeNowTimeout);
|
this._runTimersUntilTimeout(this._attachedActiveNowTimers, this._activeNowTimeout);
|
||||||
} else {
|
} else {
|
||||||
this._activeNowTimeout.restart();
|
this._activeNowTimeout.restart();
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ export default class UserActivity {
|
||||||
if (!this._activeRecentlyTimeout.isRunning()) {
|
if (!this._activeRecentlyTimeout.isRunning()) {
|
||||||
this._activeRecentlyTimeout.start();
|
this._activeRecentlyTimeout.start();
|
||||||
|
|
||||||
this._runTimersUntilTimeout(this._attachedTimersPassive, this._activeRecentlyTimeout);
|
this._runTimersUntilTimeout(this._attachedActiveRecentlyTimers, this._activeRecentlyTimeout);
|
||||||
} else {
|
} else {
|
||||||
this._activeRecentlyTimeout.restart();
|
this._activeRecentlyTimeout.restart();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue