Skip to content

Commit 714af6b

Browse files
authored
fix(ios-frame): do not update backstack when navigating the same page (NativeScript#5426)
1 parent b8e0bec commit 714af6b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tns-core-modules/ui/frame/frame.ios.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ export class Frame extends FrameBase {
3737
return this._ios;
3838
}
3939

40+
public setCurrent(entry: BackstackEntry, isBack: boolean): void {
41+
if (entry !== this._currentEntry) {
42+
this._updateBackstack(entry, isBack);
43+
}
44+
45+
super.setCurrent(entry, isBack);
46+
}
47+
4048
@profile
4149
public _navigateCore(backstackEntry: BackstackEntry) {
4250
super._navigateCore(backstackEntry);
@@ -352,7 +360,7 @@ class UINavigationControllerImpl extends UINavigationController {
352360

353361
@profile
354362
public viewDidDisappear(animated: boolean): void {
355-
super.viewDidDisappear(animated);
363+
super.viewDidDisappear(animated);
356364
const owner = this._owner.get();
357365
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
358366
owner.callUnloaded();

tns-core-modules/ui/page/page.ios.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class UIViewControllerImpl extends UIViewController {
138138
isBack = isBackNavigationTo(owner, newEntry);
139139
}
140140

141-
frame._updateBackstack(newEntry, isBack);
142141
frame.setCurrent(newEntry, isBack);
143142

144143
// If page was shown with custom animation - we need to set the navigationController.delegate to the animatedDelegate.

0 commit comments

Comments
 (0)