mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
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:
committed by
Andreas Schickinger
parent
7884e1af32
commit
ee9f030a99
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user