mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
save
This commit is contained in:
@@ -16,8 +16,7 @@ export class InactivityGuard implements CanActivate {
|
|||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
|
|
||||||
|
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||||
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin) {
|
|
||||||
return true
|
return true
|
||||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ export class HomePage implements OnInit {
|
|||||||
|
|
||||||
window['platform'] = platform
|
window['platform'] = platform
|
||||||
window['inactivity/function'] = () => {
|
window['inactivity/function'] = () => {
|
||||||
|
|
||||||
if(window.location.pathname != '/inactivity') {
|
if(window.location.pathname != '/inactivity') {
|
||||||
|
|
||||||
const pathname = window.location.pathname
|
const pathname = window.location.pathname
|
||||||
|
|||||||
@@ -212,12 +212,11 @@ export class ProfilePage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
|
|
||||||
SessionStore.setInativity(false)
|
SessionStore.setInativity(false)
|
||||||
this.router.navigateByUrl('/inactivity');
|
window['inactivity/function']()
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.router.navigateByUrl('/', { replaceUrl: true });
|
this.router.navigate(['/inactivity']);
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export class InactivityPage implements OnInit {
|
|||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
await this.authService.loginChat(this.userattempt);
|
await this.authService.loginChat(this.userattempt);
|
||||||
await this.getToken();
|
await this.getToken();
|
||||||
|
SessionStore.setInativity(true)
|
||||||
|
|
||||||
this.goback()
|
this.goback()
|
||||||
} else {
|
} else {
|
||||||
@@ -142,6 +143,7 @@ export class InactivityPage implements OnInit {
|
|||||||
|
|
||||||
goback() {
|
goback() {
|
||||||
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
||||||
|
alert(pathName)
|
||||||
this.router.navigate([pathName]);
|
this.router.navigate([pathName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user