The variable navDepth is now correctly reset to -1 when clearing history

This commit is contained in:
Rossen Hristov
2016-06-10 11:49:58 +03:00
parent 64d9e23d2d
commit b514906144

View File

@ -77,6 +77,10 @@ export class Frame extends frameCommon.Frame {
throw new Error("Required page does not have a viewController created."); throw new Error("Required page does not have a viewController created.");
} }
let clearHistory = backstackEntry.entry.clearHistory;
if (clearHistory) {
navDepth = -1;
}
navDepth++; navDepth++;
let navigationTransition: definition.NavigationTransition; let navigationTransition: definition.NavigationTransition;
@ -117,7 +121,7 @@ export class Frame extends frameCommon.Frame {
} }
// We should clear the entire history. // We should clear the entire history.
if (backstackEntry.entry.clearHistory) { if (clearHistory) {
viewController.navigationItem.hidesBackButton = true; viewController.navigationItem.hidesBackButton = true;
var newControllers = NSMutableArray.alloc().initWithCapacity(1); var newControllers = NSMutableArray.alloc().initWithCapacity(1);
newControllers.addObject(viewController); newControllers.addObject(viewController);