All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
31 lines
934 B
TypeScript
31 lines
934 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { CanActivate, CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
import * as appCommonReducer from '../reducers/app-common.reducer'
|
|
import * as appCommonActions from '../actions/app-common.actions';
|
|
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class FullScreenGuard implements CanActivate,CanActivateChild {
|
|
|
|
private loginDispatched = false;
|
|
constructor(private store: Store<appCommonReducer.State> ) { }
|
|
|
|
setFullScreen():boolean {
|
|
this.store.dispatch(new appCommonActions.FullScreen());
|
|
return true;
|
|
}
|
|
|
|
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
|
return this.setFullScreen();
|
|
}
|
|
|
|
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
|
return this.setFullScreen();
|
|
}
|
|
}
|