mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix loop
This commit is contained in:
@@ -3,12 +3,13 @@ import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Rout
|
||||
import { Observable } from 'rxjs';
|
||||
import { LocalstoreService } from '../store/localstore.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoginGuard implements CanActivate {
|
||||
constructor( private router:Router) {
|
||||
constructor( private router:Router, private platform: Platform,) {
|
||||
|
||||
}
|
||||
canActivate(
|
||||
@@ -18,10 +19,10 @@ export class LoginGuard implements CanActivate {
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||
this.router.navigate(['/home/events']);
|
||||
return false
|
||||
} else if(SessionStore.exist && !SessionStore.hasPin ) {
|
||||
} else if(SessionStore.exist && !SessionStore.hasPin && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) {
|
||||
this.router.navigate(['/pin']);
|
||||
return false
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' ) {
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||
this.router.navigate(['/inactivity']);
|
||||
return false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user