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
This commit is contained in:
Grgur Grisogono
2019-01-21 14:23:43 +01:00
committed by Manol Donev
parent 25f4b562a0
commit 19dfd163e0

View File

@ -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 && (<any>tab)._willSelectViewController;
if (!willSelectViewController
|| willSelectViewController === tab.selectedViewController) {