TypeScript strict fixes (#10138)
This commit is contained in:
parent
e57f6f0257
commit
f0f50485d7
4 changed files with 18 additions and 10 deletions
|
@ -182,11 +182,11 @@ export default class UserActivity {
|
|||
this.activeRecentlyTimeout.abort();
|
||||
};
|
||||
|
||||
private onUserActivity = (event: MouseEvent): void => {
|
||||
private onUserActivity = (event: Event): void => {
|
||||
// ignore anything if the window isn't focused
|
||||
if (!this.document.hasFocus()) return;
|
||||
|
||||
if (event.screenX && event.type === "mousemove") {
|
||||
if (event.type === "mousemove" && this.isMouseEvent(event)) {
|
||||
if (event.screenX === this.lastScreenX && event.screenY === this.lastScreenY) {
|
||||
// mouse hasn't actually moved
|
||||
return;
|
||||
|
@ -223,4 +223,8 @@ export default class UserActivity {
|
|||
}
|
||||
attachedTimers.forEach((t) => t.abort());
|
||||
}
|
||||
|
||||
private isMouseEvent(event: Event): event is MouseEvent {
|
||||
return event.type.startsWith("mouse");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue