From 88da70c386b275b3bc820eb7fe8fe1b497a2b464 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 8 Oct 2016 18:11:57 +0200 Subject: [PATCH] test(nav): pushing/pop pages from lifecycle events references #8510 --- src/components/nav/test/basic/app-module.ts | 16 ++++++++++++++++ src/navigation/nav-controller-base.ts | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/components/nav/test/basic/app-module.ts b/src/components/nav/test/basic/app-module.ts index 375e662fe8..9204380f55 100644 --- a/src/components/nav/test/basic/app-module.ts +++ b/src/components/nav/test/basic/app-module.ts @@ -28,6 +28,7 @@ export class MyCmpTest {} + @@ -125,6 +126,11 @@ export class FirstPage { }); } + pushRedirect() { + this.navCtrl.push(RedirectPage).then(() => { }, (rejectReason: string) => { + }); + } + pushFullPage() { this.navCtrl.push(FullPage, { id: 8675309, myData: [1, 2, 3, 4] }).catch(() => { }); @@ -177,6 +183,14 @@ export class FirstPage { } +@Component({template: ''}) +export class RedirectPage { + constructor(public navCtrl: NavController) { } + ionViewDidEnter() { + this.navCtrl.push(PrimaryHeaderPage); + } +} + @Component({ template: ` @@ -732,6 +746,7 @@ export const deepLinkConfig: DeepLinkConfig = { declarations: [ E2EApp, FirstPage, + RedirectPage, AnotherPage, MyCmpTest, FullPage, @@ -749,6 +764,7 @@ export const deepLinkConfig: DeepLinkConfig = { entryComponents: [ E2EApp, FirstPage, + RedirectPage, AnotherPage, FullPage, PrimaryHeaderPage, diff --git a/src/navigation/nav-controller-base.ts b/src/navigation/nav-controller-base.ts index 493876f062..5c0967e783 100644 --- a/src/navigation/nav-controller-base.ts +++ b/src/navigation/nav-controller-base.ts @@ -623,7 +623,7 @@ export class NavControllerBase extends Ion implements NavController { const duration = trns.getDuration(); // set that this nav is actively transitioning - this.setTransitioning(true, duration + ACTIVE_TRANSITION_OFFSET); + this.setTransitioning(true, duration); if (!trns.parent) { // this is the top most, or only active transition, so disable the app @@ -872,7 +872,7 @@ export class NavControllerBase extends Ion implements NavController { } setTransitioning(isTransitioning: boolean, durationPadding: number = 2000) { - this._trnsTm = (isTransitioning ? Date.now() + durationPadding : 0); + this._trnsTm = (isTransitioning ? (Date.now() + durationPadding + ACTIVE_TRANSITION_OFFSET) : 0); } getActive() { @@ -959,4 +959,4 @@ let ctrlIds = -1; const DISABLE_APP_MINIMUM_DURATION = 64; const ACTIVE_TRANSITION_MAX_TIME = 5000; -const ACTIVE_TRANSITION_OFFSET = 200; +const ACTIVE_TRANSITION_OFFSET = 400;