mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Fix event all day
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeGuard } from './home.guard';
|
||||
|
||||
describe('HomeGuard', () => {
|
||||
let guard: HomeGuard;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
guard = TestBed.inject(HomeGuard);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(guard).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,32 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HomeGuard implements CanActivate {
|
||||
constructor(
|
||||
public storageService:StorageService,
|
||||
private router:Router
|
||||
){}
|
||||
|
||||
canActivate(): Promise<boolean>{
|
||||
return new Promise(resolve => {
|
||||
/* this.storageService.get(AuthConnstants.AUTH).then(res => {
|
||||
if(res){
|
||||
resolve(true);
|
||||
}
|
||||
else{
|
||||
this.router.navigate(['']);
|
||||
resolve(false);
|
||||
}
|
||||
}).catch(err =>{
|
||||
resolve(false);
|
||||
}) */
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { IndexGuard } from './index.guard';
|
||||
|
||||
describe('IndexGuard', () => {
|
||||
let guard: IndexGuard;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
guard = TestBed.inject(IndexGuard);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(guard).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,31 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class IndexGuard implements CanActivate {
|
||||
constructor(
|
||||
public storageService:StorageService,
|
||||
private router:Router
|
||||
){}
|
||||
canActivate(): Promise<boolean> {
|
||||
return new Promise(resolve => {
|
||||
/* this.storageService.get(AuthConnstants.AUTH).then(res => {
|
||||
if(res){
|
||||
this.router.navigate(['home']);
|
||||
resolve(false);
|
||||
}
|
||||
else{
|
||||
resolve(true);
|
||||
}
|
||||
}).catch(err =>{
|
||||
resolve(false);
|
||||
}) */
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,8 @@ export class LoginGuard implements CanActivate {
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
// console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||
this.router.navigate(['/home/events']);
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user