This commit is contained in:
Anas 2024-04-26 00:25:49 +02:00 committed by GitHub
commit 1a1b107a4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -23,8 +23,8 @@ export class ReportsHomeComponent implements OnInit {
ngOnInit() {
this.homepage$ = this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
map((event) => (event as NavigationEnd).urlAfterRedirects.endsWith("/reports")),
startWith(true),
map((event) => this.isReportsHomepageRouteUrl((event as NavigationEnd).urlAfterRedirects)),
startWith(this.isReportsHomepageRouteUrl(this.router.url)),
);
this.reports$ = this.route.params.pipe(
@ -61,4 +61,8 @@ export class ReportsHomeComponent implements OnInit {
},
];
}
private isReportsHomepageRouteUrl(url: string): boolean {
return url.endsWith("/reports");
}
}