Now reloading employee-card for every visit to avoid cache-problems
This commit is contained in:
@@ -131,7 +131,7 @@
|
||||
</footer>
|
||||
</section>
|
||||
<ng-template #loadingRef>
|
||||
<digi-ng-skeleton-base [afCount]="3" afText="Laddar personalkortet"></digi-ng-skeleton-base>
|
||||
<digi-ng-skeleton-base [afCount]="3" afText="Laddar personalkonto"></digi-ng-skeleton-base>
|
||||
</ng-template>
|
||||
<ng-template #emptyDD class="employee-card__list">
|
||||
<dd>
|
||||
|
||||
@@ -30,6 +30,7 @@ export class EmployeeCardComponent implements OnDestroy {
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.employeeService.resetLastUpdatedEmployeeId();
|
||||
this.employeeService.setCurrentEmployeeId(null);
|
||||
}
|
||||
|
||||
get employeeId(): string {
|
||||
|
||||
@@ -50,11 +50,11 @@ export class EmployeeService extends UnsubscribeDirective {
|
||||
super.unsubscribeOnDestroy(
|
||||
combineLatest([this._currentEmployeeId$, this._lastUpdatedEmployeeId$])
|
||||
.pipe(
|
||||
filter(([currentEmployeeId]) => !!currentEmployeeId),
|
||||
distinctUntilChanged(
|
||||
([prevEmployeeId], [currEmployeeId, currLastUpdatedEmployeeId]) =>
|
||||
!currLastUpdatedEmployeeId && prevEmployeeId === currEmployeeId
|
||||
),
|
||||
filter(([currentEmployeeId]) => !!currentEmployeeId),
|
||||
switchMap(([currentEmployeeId]) =>
|
||||
this._fetchEmployee$(currentEmployeeId).pipe(filter(employee => !!employee))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user