You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Consider mouse-clicking as user activity
It's a bit non-sensical that moving the mouse constitutes user activity, but clicking it does not. Fix it.
This commit is contained in:
@@ -30,6 +30,7 @@ class UserActivity {
|
|||||||
* Start listening to user activity
|
* Start listening to user activity
|
||||||
*/
|
*/
|
||||||
start() {
|
start() {
|
||||||
|
document.onmousedown = this._onUserActivity.bind(this);
|
||||||
document.onmousemove = this._onUserActivity.bind(this);
|
document.onmousemove = this._onUserActivity.bind(this);
|
||||||
document.onkeypress = this._onUserActivity.bind(this);
|
document.onkeypress = this._onUserActivity.bind(this);
|
||||||
// can't use document.scroll here because that's only the document
|
// can't use document.scroll here because that's only the document
|
||||||
@@ -46,6 +47,7 @@ class UserActivity {
|
|||||||
* Stop tracking user activity
|
* Stop tracking user activity
|
||||||
*/
|
*/
|
||||||
stop() {
|
stop() {
|
||||||
|
document.onmousedown = undefined;
|
||||||
document.onmousemove = undefined;
|
document.onmousemove = undefined;
|
||||||
document.onkeypress = undefined;
|
document.onkeypress = undefined;
|
||||||
window.removeEventListener('wheel', this._onUserActivity.bind(this), true);
|
window.removeEventListener('wheel', this._onUserActivity.bind(this), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user