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
+12
View File
@@ -31,6 +31,7 @@ export class ProfilePage implements OnInit {
location: "Gabinete"; location: "Gabinete";
isProfileOpen = false isProfileOpen = false
hideImage = false hideImage = false
logoutOut = false
constructor(private modalController: ModalController, constructor(private modalController: ModalController,
private authService: AuthService, private authService: AuthService,
@@ -47,6 +48,7 @@ export class ProfilePage implements OnInit {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
router.events.subscribe((val) => { router.events.subscribe((val) => {
this.isProfileOpen = false this.isProfileOpen = false
this.logoutOut = true
}); });
setTimeout(()=>{ setTimeout(()=>{
@@ -210,9 +212,19 @@ export class ProfilePage implements OnInit {
logout() { logout() {
SessionStore.setInativity(false) SessionStore.setInativity(false)
SessionStore.setUrlBeforeInactivity(this.router.url); SessionStore.setUrlBeforeInactivity(this.router.url);
this.logoutOut == false
setTimeout(() => { setTimeout(() => {
// alert('logout') // alert('logout')
this.router.navigateByUrl('/', { replaceUrl: true }); this.router.navigateByUrl('/', { replaceUrl: true });
this.router.navigate(['/']);
setTimeout(() =>{
if(this.logoutOut == false) {
window.location.pathname = '/'
}
}, 500)
}, 100) }, 100)
} }
+20 -20
View File
@@ -11,28 +11,28 @@ export class InativityService {
private router: Router, private router: Router,
) { ) {
var time; // var time;
window.onload = resetTimer; // window.onload = resetTimer;
window.onmousemove = resetTimer; // window.onmousemove = resetTimer;
window.onmousedown = resetTimer; // catches touchscreen presses as well // window.onmousedown = resetTimer; // catches touchscreen presses as well
window.ontouchstart = resetTimer; // catches touchscreen swipes as well // window.ontouchstart = resetTimer; // catches touchscreen swipes as well
window.onclick = resetTimer; // catches touchpad clicks as well // window.onclick = resetTimer; // catches touchpad clicks as well
window.onkeydown = resetTimer; // window.onkeydown = resetTimer;
window.addEventListener('scroll', resetTimer, true); // improved; see comments // window.addEventListener('scroll', resetTimer, true); // improved; see comments
function userIsNotActive() { // function userIsNotActive() {
// your function for too long inactivity goes here // // your function for too long inactivity goes here
// SessionStore.setInativity(false) // // SessionStore.setInativity(false)
// alert('go out') // // alert('go out')
try { // try {
// window['inactivity/function']() // // window['inactivity/function']()
} catch (error) {} // } catch (error) {}
} // }
function resetTimer() { // function resetTimer() {
clearTimeout(time); // clearTimeout(time);
time = setTimeout(userIsNotActive, 60000 * 1); // time is in milliseconds // time = setTimeout(userIsNotActive, 60000 * 1); // time is in milliseconds
} // }
} }
} }
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "3709de00e", "shortSHA": "2f13e82c9",
"SHA": "3709de00ed6b3fe9153de6edcc6befe392cfb2d8", "SHA": "2f13e82c96626aa0088dc2c9afeb0fcc491aa6d6",
"branch": "develop_bitOut-fix", "branch": "develop_bitOut-fix",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Wed Jan 4 11:27:40 2023 +0100'", "lastCommitTime": "'Wed Jan 4 12:16:44 2023 +0100'",
"lastCommitMessage": "save", "lastCommitMessage": "chat loader",
"lastCommitNumber": "4610", "lastCommitNumber": "4611",
"change": "", "change": "",
"changeStatus": "On branch develop_bitOut-fix\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/preview-camera/preview-camera.page.html\n\tmodified: src/app/pages/chat/chat.page.html", "changeStatus": "On branch develop_bitOut-fix\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/profile/profile.page.ts\n\tmodified: src/app/services/inativity.service.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }