From 714af6bb0281392d6077450e3e5effc0ca1cc244 Mon Sep 17 00:00:00 2001 From: Alexander Djenkov Date: Mon, 19 Feb 2018 11:53:04 +0200 Subject: [PATCH] fix(ios-frame): do not update backstack when navigating the same page (#5426) --- tns-core-modules/ui/frame/frame.ios.ts | 10 +++++++++- tns-core-modules/ui/page/page.ios.ts | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tns-core-modules/ui/frame/frame.ios.ts b/tns-core-modules/ui/frame/frame.ios.ts index 02ef54436..070da5f63 100644 --- a/tns-core-modules/ui/frame/frame.ios.ts +++ b/tns-core-modules/ui/frame/frame.ios.ts @@ -37,6 +37,14 @@ export class Frame extends FrameBase { return this._ios; } + public setCurrent(entry: BackstackEntry, isBack: boolean): void { + if (entry !== this._currentEntry) { + this._updateBackstack(entry, isBack); + } + + super.setCurrent(entry, isBack); + } + @profile public _navigateCore(backstackEntry: BackstackEntry) { super._navigateCore(backstackEntry); @@ -352,7 +360,7 @@ class UINavigationControllerImpl extends UINavigationController { @profile public viewDidDisappear(animated: boolean): void { - super.viewDidDisappear(animated); + super.viewDidDisappear(animated); const owner = this._owner.get(); if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) { owner.callUnloaded(); diff --git a/tns-core-modules/ui/page/page.ios.ts b/tns-core-modules/ui/page/page.ios.ts index bd3e42c25..a7a1d98d6 100644 --- a/tns-core-modules/ui/page/page.ios.ts +++ b/tns-core-modules/ui/page/page.ios.ts @@ -138,7 +138,6 @@ class UIViewControllerImpl extends UIViewController { isBack = isBackNavigationTo(owner, newEntry); } - frame._updateBackstack(newEntry, isBack); frame.setCurrent(newEntry, isBack); // If page was shown with custom animation - we need to set the navigationController.delegate to the animatedDelegate.