This commit is contained in:
Peter Maquiran
2023-01-04 14:45:17 +01:00
parent 2f13e82c96
commit 0d485672d8
3 changed files with 38 additions and 26 deletions
+20 -20
View File
@@ -11,28 +11,28 @@ export class InativityService {
private router: Router,
) {
var time;
window.onload = resetTimer;
window.onmousemove = resetTimer;
window.onmousedown = resetTimer; // catches touchscreen presses as well
window.ontouchstart = resetTimer; // catches touchscreen swipes as well
window.onclick = resetTimer; // catches touchpad clicks as well
window.onkeydown = resetTimer;
window.addEventListener('scroll', resetTimer, true); // improved; see comments
// var time;
// window.onload = resetTimer;
// window.onmousemove = resetTimer;
// window.onmousedown = resetTimer; // catches touchscreen presses as well
// window.ontouchstart = resetTimer; // catches touchscreen swipes as well
// window.onclick = resetTimer; // catches touchpad clicks as well
// window.onkeydown = resetTimer;
// window.addEventListener('scroll', resetTimer, true); // improved; see comments
function userIsNotActive() {
// your function for too long inactivity goes here
// SessionStore.setInativity(false)
// alert('go out')
try {
// window['inactivity/function']()
} catch (error) {}
// function userIsNotActive() {
// // your function for too long inactivity goes here
// // SessionStore.setInativity(false)
// // alert('go out')
// try {
// // window['inactivity/function']()
// } catch (error) {}
}
// }
function resetTimer() {
clearTimeout(time);
time = setTimeout(userIsNotActive, 60000 * 1); // time is in milliseconds
}
// function resetTimer() {
// clearTimeout(time);
// time = setTimeout(userIsNotActive, 60000 * 1); // time is in milliseconds
// }
}
}