Skip to content

Commit 57aed9c

Browse files
Merge branch 'djenkov/modal-root-tab' of https://github.com/NativeScript/nativescript-angular into djenkov/modal-root-tab
2 parents 1508f1e + 2e7404b commit 57aed9c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,10 @@ export class NSLocationStrategy extends LocationStrategy {
364364

365365
// currentOutlet should be the one that corresponds to the topmost() frame
366366
const topmostOutlet = this.getOutletByFrame(this.frameService.getFrame());
367-
const currentOutlet = this.findOutletByModal(this._modalNavigationDepth, true) || topmostOutlet;
367+
this.currentOutlet = this.findOutletByModal(this._modalNavigationDepth, true) || topmostOutlet;
368368

369-
if (currentOutlet) {
370-
this.currentOutlet = currentOutlet;
369+
if (this.currentOutlet) {
371370
this.currentOutlet.showingModal = false;
372-
373371
this.callPopState(this.currentOutlet.peekState(), false);
374372
}
375373
}
@@ -422,7 +420,11 @@ export class NSLocationStrategy extends LocationStrategy {
422420

423421
clearOutlet(frame: Frame) {
424422
this.outlets = this.outlets.filter(currentOutlet => {
425-
const isEqualToCurrent = currentOutlet.pathByOutlets === this.currentOutlet.pathByOutlets;
423+
let isEqualToCurrent;
424+
425+
if (this.currentOutlet) {
426+
isEqualToCurrent = currentOutlet.pathByOutlets === this.currentOutlet.pathByOutlets;
427+
}
426428

427429
// Remove outlet from the url tree.
428430
if (currentOutlet.frame === frame && !isEqualToCurrent) {

0 commit comments

Comments
 (0)