From 88715e5c93af57dbd39c97e3cca5ca66e692e615 Mon Sep 17 00:00:00 2001 From: Iragne Date: Tue, 5 May 2015 09:25:01 -0700 Subject: [PATCH] Update RCTNavigator.m Summary: Related to this issue I created the PR. Feel free to talk about it. https://github.com/facebook/react-native/issues/65#issuecomment-93240332 Thanks Closes https://github.com/facebook/react-native/pull/1131 Github Author: Iragne Test Plan: Open NavigatorIOS example in UIExplorer, push recurse navigation several times. Press back and observe that it no longer breaks. --- React/Views/RCTNavigator.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/React/Views/RCTNavigator.m b/React/Views/RCTNavigator.m index f947a6128e23ba..57415fbb79a8ce 100644 --- a/React/Views/RCTNavigator.m +++ b/React/Views/RCTNavigator.m @@ -461,6 +461,10 @@ - (void)reactBridgeDidFinishTransaction // --- previously caught up -------- ------- still caught up ---------- viewControllerCount == previousReactCount && currentReactCount == previousReactCount; +BOOL jsGettingtooSlow = + // --- previously not caught up -------- ------- no longer caught up ---------- + viewControllerCount < previousReactCount && currentReactCount < previousReactCount; + BOOL reactPushOne = jsGettingAhead && currentReactCount == previousReactCount + 1; BOOL reactPopN = jsGettingAhead && currentReactCount < previousReactCount; @@ -471,7 +475,8 @@ - (void)reactBridgeDidFinishTransaction if (!(jsGettingAhead || jsCatchingUp || jsMakingNoProgressButNeedsToCatchUp || - jsMakingNoProgressAndDoesntNeedTo)) { + jsMakingNoProgressAndDoesntNeedTo || + jsGettingtooSlow)) { RCTLogError(@"JS has only made partial progress to catch up to UIKit"); } if (currentReactCount > _currentViews.count) {