remote inactivity

This commit is contained in:
Peter Maquiran
2023-01-02 14:36:57 +01:00
parent f640ac7e33
commit 3e110c9e93
4 changed files with 16 additions and 39 deletions
+4 -3
View File
@@ -104,15 +104,16 @@ export class HomePage implements OnInit {
if (window.location.pathname != '/inactivity') {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
document.querySelectorAll('.popover-viewport').forEach((e: any) => e.remove())
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove());
document.querySelectorAll('.popover-viewport').forEach((e: any) => e.remove());
document.querySelectorAll('.loading-blocker').forEach((e: any) => e.remove());
const pathname = window.location.pathname
SessionStore.setUrlBeforeInactivity(pathname)
if (this.platform.is('mobileweb')) {
this.router.navigate(['/inactivity']);
}else{
} else {
this.router.navigate(['/']);
}
}
+6 -3
View File
@@ -22,14 +22,17 @@ export class InativityService {
function userIsNotActive() {
// your function for too long inactivity goes here
SessionStore.setInativity(false)
// SessionStore.setInativity(false)
// alert('go out')
window['inactivity/function']()
try {
// window['inactivity/function']()
} catch (error) {}
}
function resetTimer() {
clearTimeout(time);
time = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds
time = setTimeout(userIsNotActive, 60000 * 1); // time is in milliseconds
}
}
}