From ee9f030a99c283b82842f5ef5d1529ac47292bd5 Mon Sep 17 00:00:00 2001 From: Nino Righi Date: Mon, 1 Dec 2025 11:25:11 +0000 Subject: [PATCH] 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 --- .../src/page/customer/customer-page.component.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/isa-app/src/page/customer/customer-page.component.ts b/apps/isa-app/src/page/customer/customer-page.component.ts index 429a24b24..efb8c7453 100644 --- a/apps/isa-app/src/page/customer/customer-page.component.ts +++ b/apps/isa-app/src/page/customer/customer-page.component.ts @@ -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'); + } }