File tree Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,6 @@ void onBatchComplete() override {
152
152
153
153
@implementation RCTCxxBridge
154
154
{
155
- BOOL _wasBatchActive;
156
155
BOOL _didInvalidate;
157
156
BOOL _moduleRegistryCreated;
158
157
@@ -1348,7 +1347,7 @@ - (void)stopProfiling:(void (^)(NSData *))callback
1348
1347
1349
1348
- (BOOL )isBatchActive
1350
1349
{
1351
- return _wasBatchActive ;
1350
+ return _reactInstance ? _reactInstance-> isBatchActive () : NO ;
1352
1351
}
1353
1352
1354
1353
- (void *)runtime
Original file line number Diff line number Diff line change @@ -149,6 +149,10 @@ void *Instance::getJavaScriptContext() {
149
149
bool Instance::isInspectable () {
150
150
return nativeToJsBridge_ ? nativeToJsBridge_->isInspectable () : false ;
151
151
}
152
+
153
+ bool Instance::isBatchActive () {
154
+ return nativeToJsBridge_ ? nativeToJsBridge_->isBatchActive () : false ;
155
+ }
152
156
153
157
void Instance::callJSFunction (std::string &&module , std::string &&method,
154
158
folly::dynamic &¶ms) {
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class RN_EXPORT Instance {
58
58
std::unique_ptr<const JSBigString> jsonValue);
59
59
void *getJavaScriptContext ();
60
60
bool isInspectable ();
61
+ bool isBatchActive ();
61
62
void callJSFunction (std::string &&module , std::string &&method,
62
63
folly::dynamic &¶ms);
63
64
void callJSCallback (uint64_t callbackId, folly::dynamic &¶ms);
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ class JsToNativeBridge : public react::ExecutorDelegate {
37
37
std::shared_ptr<ModuleRegistry> getModuleRegistry () override {
38
38
return m_registry;
39
39
}
40
+
41
+ bool isBatchActive () {
42
+ return m_batchHadNativeModuleCalls;
43
+ }
40
44
41
45
void callNativeModules (
42
46
JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) override {
@@ -222,6 +226,10 @@ void* NativeToJsBridge::getJavaScriptContext() {
222
226
bool NativeToJsBridge::isInspectable () {
223
227
return m_executor->isInspectable ();
224
228
}
229
+
230
+ bool NativeToJsBridge::isBatchActive () {
231
+ return m_delegate->isBatchActive ();
232
+ }
225
233
226
234
void NativeToJsBridge::handleMemoryPressure (int pressureLevel) {
227
235
runOnExecutorQueue ([=] (JSExecutor* executor) {
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ class NativeToJsBridge {
75
75
void setGlobalVariable (std::string propName, std::unique_ptr<const JSBigString> jsonValue);
76
76
void * getJavaScriptContext ();
77
77
bool isInspectable ();
78
+ bool isBatchActive ();
78
79
79
80
void handleMemoryPressure (int pressureLevel);
80
81
You can’t perform that action at this time.
0 commit comments