From 457fca4cb3ea81faf8e7ca9d4a9b4da2f724c073 Mon Sep 17 00:00:00 2001 From: Ruben Niculcea Date: Mon, 22 Jun 2015 06:55:35 -0700 Subject: [PATCH] Allow live reload even on errors. Summary: Live reload is disabled when an error has occurred. This requires the developer to fix the error and then switch to the simulator to reload the device manually; impacting developer flow and increasing alt tabbing. This pull request fixes that by allowing live reload to work even on errors. This fixes issue: #1343. Closes https://github.com/facebook/react-native/pull/1549 Github Author: Ruben Niculcea Test Plan: Imported from GitHub, without a `Test Plan:` line. --- React/Base/RCTBridge.m | 2 ++ React/Base/RCTDevMenu.m | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index d7ec0ac48..5a03d25b0 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -995,6 +995,8 @@ RCT_INNER_BRIDGE_ONLY(_invokeAndProcessModule:(__unused NSString *)module return; } + [[RCTRedBox sharedInstance] dismiss]; + RCTSourceCode *sourceCodeModule = self.modules[RCTBridgeModuleNameForClass([RCTSourceCode class])]; sourceCodeModule.scriptURL = bundleURL; sourceCodeModule.scriptText = script; diff --git a/React/Base/RCTDevMenu.m b/React/Base/RCTDevMenu.m index ed936bbe8..a37562912 100644 --- a/React/Base/RCTDevMenu.m +++ b/React/Base/RCTDevMenu.m @@ -119,6 +119,11 @@ RCT_EXPORT_MODULE() name:RCTJavaScriptDidLoadNotification object:nil]; + [notificationCenter addObserver:self + selector:@selector(jsLoaded:) + name:RCTJavaScriptDidFailToLoadNotification + object:nil]; + _defaults = [NSUserDefaults standardUserDefaults]; _settings = [[NSMutableDictionary alloc] init]; _extraMenuItems = [NSMutableArray array];