improve chat

This commit is contained in:
Peter Maquiran
2023-01-09 10:49:58 +01:00
parent 56c1733945
commit a73dde467c
21 changed files with 436 additions and 373 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 * 5); // time is in milliseconds
}
}
}