mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve chat
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user