Merged PR 1203: #3062 Clear Items Cache If Navigate to Remission

#3062 Clear Items Cache If Navigate to Remission
This commit is contained in:
Nino Righi
2022-04-27 14:05:53 +00:00
committed by Andreas Schickinger
parent b666e4b38c
commit 833542f303

View File

@@ -2,6 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { ApplicationService } from '@core/application';
import { BreadcrumbService } from '@core/breadcrumb';
import { CacheService } from '@core/cache';
import { Config } from '@core/config';
import { Subject } from 'rxjs';
import { filter, first, takeUntil } from 'rxjs/operators';
@@ -23,11 +24,13 @@ export class RemissionComponent implements OnInit, OnDestroy {
private readonly _config: Config,
private _activatedRoute: ActivatedRoute,
private _applicationService: ApplicationService,
private _router: Router
private _router: Router,
private _cache: CacheService
) {}
ngOnInit(): void {
this.addBreadcrumbIfNotExists();
this.clearCache();
this._router.events
?.pipe(
@@ -75,4 +78,8 @@ export class RemissionComponent implements OnInit, OnDestroy {
});
}
}
clearCache() {
this._cache.delete({ processId: String(this.processId) });
}
}