mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
The variable navDepth is now correctly reset to -1 when clearing history
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user