From 6a3ef5b14eb99d4823ebf1c1aecdf299dc0d54a5 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 30 Aug 2021 11:41:21 +0100 Subject: [PATCH] save --- src/app/guards/inactivity.guard.ts | 3 +-- src/app/home/home.page.ts | 1 + src/app/modals/profile/profile.page.ts | 7 +++---- src/app/pages/inactivity/inactivity.page.ts | 2 ++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/guards/inactivity.guard.ts b/src/app/guards/inactivity.guard.ts index a00a13a3f..59e88cb68 100644 --- a/src/app/guards/inactivity.guard.ts +++ b/src/app/guards/inactivity.guard.ts @@ -16,8 +16,7 @@ export class InactivityGuard implements CanActivate { route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - - if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin) { + if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) { return true } else if(SessionStore.exist && !SessionStore.user.Inactivity) { return true diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index a6f15c07a..121484eed 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -82,6 +82,7 @@ export class HomePage implements OnInit { window['platform'] = platform window['inactivity/function'] = () => { + if(window.location.pathname != '/inactivity') { const pathname = window.location.pathname diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 9edec4567..043316723 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -212,12 +212,11 @@ export class ProfilePage implements OnInit { } logout() { - SessionStore.setInativity(false) - this.router.navigateByUrl('/inactivity'); - + window['inactivity/function']() + setTimeout(() => { - this.router.navigateByUrl('/', { replaceUrl: true }); + this.router.navigate(['/inactivity']); }, 100) } diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index 4c3a98682..a72d85de2 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -79,6 +79,7 @@ export class InactivityPage implements OnInit { await this.authService.SetSession(attempt, this.userattempt); await this.authService.loginChat(this.userattempt); await this.getToken(); + SessionStore.setInativity(true) this.goback() } else { @@ -142,6 +143,7 @@ export class InactivityPage implements OnInit { goback() { const pathName = this.SessionStore.user.UrlBeforeInactivity + alert(pathName) this.router.navigate([pathName]); }