Merged PR 2062: fix(isa-app-customer): Clear Navigation State Context if Customer Area gets d...

fix(isa-app-customer): Clear Navigation State Context if Customer Area gets destroyed

Ref: #5512
This commit is contained in:
Nino Righi
2025-12-01 11:25:11 +00:00
committed by Andreas Schickinger
parent 7884e1af32
commit ee9f030a99

View File

@@ -1,5 +1,11 @@
import { Component, ChangeDetectionStrategy } from '@angular/core';
import {
Component,
ChangeDetectionStrategy,
OnDestroy,
inject,
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NavigationStateService } from '@isa/core/navigation';
import { map } from 'rxjs/operators';
@Component({
@@ -9,8 +15,14 @@ import { map } from 'rxjs/operators';
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
})
export class CustomerComponent {
export class CustomerComponent implements OnDestroy {
private _navigationState = inject(NavigationStateService);
processId$ = this._activatedRoute.data.pipe(map((data) => data.processId));
constructor(private _activatedRoute: ActivatedRoute) {}
async ngOnDestroy() {
// #5512 Always clear preserved select-customer context if navigating out of customer area
await this._navigationState.clearPreservedContext('select-customer');
}
}