Fix fm-hasclaim
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -14,11 +14,11 @@ export class HasClaimDirective implements OnInit{
|
||||
@Input('fm-hasclaim') claim:string;
|
||||
|
||||
constructor(private templateRef$: TemplateRef<any>,private viewContainerRef$: ViewContainerRef,private store$: Store<appCommonReducer.State>) { }
|
||||
private user$:Observable<IUser> = this.store$.select(appCommonReducer.SelectGetUser).pipe(skip(1));
|
||||
private user$:Observable<IUser> = this.store$.select(appCommonReducer.SelectGetUser);
|
||||
private hasView = false;
|
||||
ngOnInit() {
|
||||
this.user$.subscribe((user) => {
|
||||
if (user.claims[this.claim]) {
|
||||
if (user && user.claims[this.claim]) {
|
||||
this.viewContainerRef$.createEmbeddedView(this.templateRef$);
|
||||
this.hasView=true;
|
||||
} else if (this.hasView) {
|
||||
|
Reference in New Issue
Block a user