Skip to content

Commit 130e392

Browse files
ADjenkovADjenkov
ADjenkov
authored and
ADjenkov
committed
fix(p-r-o): needless forward navigation after back inside nested named outlet
1 parent d5ccaf5 commit 130e392

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: nativescript-angular/router/page-router-outlet.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,7 @@ export class PageRouterOutlet implements OnDestroy { // tslint:disable-line:dire
423423
if (modalNavigation > 0) { // Modal with 'primary' p-r-o
424424
outlet = this.locationStrategy.findOutletByModal(modalNavigation);
425425
} else {
426-
const pathByOutlets = this.locationStrategy.getPathByOutlets(topActivatedRoute);
427426
outlet = this.locationStrategy.findOutletByKey(outletKey);
428-
outlet = outlet || this.locationStrategy.findOutletByOutletPath(pathByOutlets);
429427
}
430428

431429
// Named lazy loaded outlet.
@@ -436,6 +434,9 @@ export class PageRouterOutlet implements OnDestroy { // tslint:disable-line:dire
436434
if (outlet) {
437435
outlet.outletKeys.push(outletKey);
438436
}
437+
} else if (!outlet) {
438+
const pathByOutlets = this.locationStrategy.getPathByOutlets(topActivatedRoute);
439+
outlet = this.locationStrategy.findOutletByOutletPath(pathByOutlets);
439440
}
440441

441442
return outlet;

0 commit comments

Comments
 (0)