From 19dfd163e090ef8de789d1b62a39538e0ffc9892 Mon Sep 17 00:00:00 2001 From: Grgur Grisogono Date: Mon, 21 Jan 2019 14:23:43 +0100 Subject: [PATCH] fix: call onNavigatingFrom event only if it exists (#6773) I ran into an issue where `owner.onNavigatingFrom` didn't exist when rendering a view was blocked by the biometric scanner and then user hit the back button to navigate back. This code simply adds a check to see if `onNavigatingFrom` exists on the owner --- tns-core-modules/ui/page/page.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tns-core-modules/ui/page/page.ios.ts b/tns-core-modules/ui/page/page.ios.ts index 3ca6fe887..e00a3b2bd 100644 --- a/tns-core-modules/ui/page/page.ios.ts +++ b/tns-core-modules/ui/page/page.ios.ts @@ -177,7 +177,7 @@ class UIViewControllerImpl extends UIViewController { // or because we are closing a modal page, // or because we are in tab and another controller is selected. const tab = this.tabBarController; - if (!owner._presentedViewController && !this.presentingViewController && frame && frame.currentPage === owner) { + if (owner.onNavigatingFrom && !owner._presentedViewController && !this.presentingViewController && frame && frame.currentPage === owner) { const willSelectViewController = tab && (tab)._willSelectViewController; if (!willSelectViewController || willSelectViewController === tab.selectedViewController) {