fix issue where invalidateRootCache didn't happen when the page first loaded

This commit is contained in:
Art Lowel
2023-09-22 12:00:59 +02:00
parent 5ad621b27e
commit 8fbe8c16dc
2 changed files with 8 additions and 2 deletions

View File

@@ -52,6 +52,10 @@ export class ServerCheckGuard implements CanActivateChild {
* operation, the cached version is used.
*/
listenForRouteChanges(): void {
// we'll always be too late for the first NavigationStart event with the router subscribe below,
// so this statement is for the very first route operation
this.rootDataService.invalidateRootCache();
this.router.events.pipe(
filter(event => event instanceof NavigationStart),
).subscribe(() => {