Add fmPackageExists directive
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2022-03-16 14:20:28 +01:00
parent 521b882798
commit 713af307cd
7 changed files with 59 additions and 3 deletions

View File

@@ -14,10 +14,14 @@ import {Observable} from 'rxjs';
})
export class PackageService {
private userPackages: { [key: string]: IPackage } = {};
private packages: { [key: string]: IPackage } = {};
constructor(private store$: Store<appCommonReducer.State>, public httpClient: HttpClient, public appConfig: AppConfig) {
store$.select(appCommonReducer.SelectGetValidUserPackages).subscribe((packages) => {
this.userPackages = packages;
});
store$.select(appCommonReducer.SelectGetPackages).subscribe((packages) => {
this.packages = packages;
});
}
@@ -27,6 +31,10 @@ export class PackageService {
}
hasPackage(id: string): boolean {
return id in this.userPackages;
}
packageExists(id: string): boolean {
return id in this.packages;
}