Skip to content

Commit 145ba30

Browse files
ADjenkovADjenkov
authored andcommitted
fix(location-strategy): going back to tab with nested outlets crashes.
Update last state segmentGroup of parent Outlet
1 parent 4fbc56a commit 145ba30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nativescript-angular/router/ns-location-strategy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ export class NSLocationStrategy extends LocationStrategy {
527527
if (!lastState || !equalStateUrls) {
528528
outlet.states.push(locationState);
529529

530+
// Update last state segmentGroup of parent Outlet.
530531
if (this._modalNavigationDepth === 0 && !outlet.showingModal) {
531532
this.updateParentsStates(outlet, currentSegmentGroup.parent);
532533
}
@@ -566,6 +567,11 @@ export class NSLocationStrategy extends LocationStrategy {
566567
newOutlet.parent = parent;
567568
this.outlets.push(newOutlet);
568569

570+
// Update last state segmentGroup of parent Outlet.
571+
if (this._modalNavigationDepth === 0 && !newOutlet.showingModal) {
572+
this.updateParentsStates(newOutlet, segmentGroup.parent);
573+
}
574+
569575
return newOutlet;
570576
}
571577

0 commit comments

Comments
 (0)