mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
LogBox iOS: don't initialize logbox window if redbox flag is disabled
Summary: If redbox flag is disabled, don't initialize LogBox window even if the native module exists. This makes the module noop. Changelog: [Internal] Reviewed By: shergin Differential Revision: D18927309 fbshipit-source-id: 3dc6c08ed537925594cabf77d1142568d47132e9
This commit is contained in:
committed by
Rick Hanlon
parent
76557f00d7
commit
e97baa6066
@@ -15,6 +15,7 @@
|
||||
#import <React/RCTErrorInfo.h>
|
||||
#import <React/RCTEventDispatcher.h>
|
||||
#import <React/RCTJSStackFrame.h>
|
||||
#import <React/RCTRedBoxSetEnabled.h>
|
||||
#import <React/RCTReloadCommand.h>
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
@@ -102,10 +103,13 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)setBridge:(RCTBridge *)bridge
|
||||
{
|
||||
_bridge = bridge;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self->_window = [[RCTLogBoxWindow alloc] initWithFrame:[UIScreen mainScreen].bounds bridge: self->_bridge];
|
||||
});
|
||||
_bridge = bridge;
|
||||
|
||||
if (RCTRedBoxGetEnabled()) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self->_window = [[RCTLogBoxWindow alloc] initWithFrame:[UIScreen mainScreen].bounds bridge: self->_bridge];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(show)
|
||||
|
||||
Reference in New Issue
Block a user