From b514906144f73355338e8fb841d31ce57d9d8204 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Fri, 10 Jun 2016 11:49:58 +0300 Subject: [PATCH] The variable navDepth is now correctly reset to -1 when clearing history --- tns-core-modules/ui/frame/frame.ios.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/frame/frame.ios.ts b/tns-core-modules/ui/frame/frame.ios.ts index 54525988b..ae7a1eb5e 100644 --- a/tns-core-modules/ui/frame/frame.ios.ts +++ b/tns-core-modules/ui/frame/frame.ios.ts @@ -77,6 +77,10 @@ export class Frame extends frameCommon.Frame { throw new Error("Required page does not have a viewController created."); } + let clearHistory = backstackEntry.entry.clearHistory; + if (clearHistory) { + navDepth = -1; + } navDepth++; let navigationTransition: definition.NavigationTransition; @@ -117,7 +121,7 @@ export class Frame extends frameCommon.Frame { } // We should clear the entire history. - if (backstackEntry.entry.clearHistory) { + if (clearHistory) { viewController.navigationItem.hidesBackButton = true; var newControllers = NSMutableArray.alloc().initWithCapacity(1); newControllers.addObject(viewController);