From 130e392d7660772af12aa8f6dd381bc441d1bb9b Mon Sep 17 00:00:00 2001 From: ADjenkov Date: Mon, 17 Dec 2018 17:16:39 +0200 Subject: [PATCH] fix(p-r-o): needless forward navigation after back inside nested named outlet --- nativescript-angular/router/page-router-outlet.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nativescript-angular/router/page-router-outlet.ts b/nativescript-angular/router/page-router-outlet.ts index 65e353ceb..a1481e2e4 100644 --- a/nativescript-angular/router/page-router-outlet.ts +++ b/nativescript-angular/router/page-router-outlet.ts @@ -423,9 +423,7 @@ export class PageRouterOutlet implements OnDestroy { // tslint:disable-line:dire if (modalNavigation > 0) { // Modal with 'primary' p-r-o outlet = this.locationStrategy.findOutletByModal(modalNavigation); } else { - const pathByOutlets = this.locationStrategy.getPathByOutlets(topActivatedRoute); outlet = this.locationStrategy.findOutletByKey(outletKey); - outlet = outlet || this.locationStrategy.findOutletByOutletPath(pathByOutlets); } // Named lazy loaded outlet. @@ -436,6 +434,9 @@ export class PageRouterOutlet implements OnDestroy { // tslint:disable-line:dire if (outlet) { outlet.outletKeys.push(outletKey); } + } else if (!outlet) { + const pathByOutlets = this.locationStrategy.getPathByOutlets(topActivatedRoute); + outlet = this.locationStrategy.findOutletByOutletPath(pathByOutlets); } return outlet;