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 @@ -156,7 +156,6 @@ void onBatchComplete() override {
156
156
157
157
@implementation RCTCxxBridge
158
158
{
159
- BOOL _wasBatchActive;
160
159
BOOL _didInvalidate;
161
160
BOOL _moduleRegistryCreated;
162
161
@@ -1306,7 +1305,7 @@ - (void)stopProfiling:(void (^)(NSData *))callback
1306
1305
1307
1306
- (BOOL )isBatchActive
1308
1307
{
1309
- return _wasBatchActive ;
1308
+ return _reactInstance ? _reactInstance-> isBatchActive () : NO ;
1310
1309
}
1311
1310
1312
1311
@end
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ bool Instance::isInspectable() {
147
147
return nativeToJsBridge_ ? nativeToJsBridge_->isInspectable () : false ;
148
148
}
149
149
150
+ bool Instance::isBatchActive () {
151
+ return nativeToJsBridge_ ? nativeToJsBridge_->isBatchActive () : false ;
152
+ }
153
+
150
154
void Instance::callJSFunction (std::string &&module , std::string &&method,
151
155
folly::dynamic &¶ms) {
152
156
callback_->incrementPendingJSCalls ();
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class RN_EXPORT Instance {
56
56
std::unique_ptr<const JSBigString> jsonValue);
57
57
void *getJavaScriptContext ();
58
58
bool isInspectable ();
59
+ bool isBatchActive ();
59
60
void callJSFunction (std::string &&module , std::string &&method,
60
61
folly::dynamic &¶ms);
61
62
void callJSCallback (uint64_t callbackId, folly::dynamic &¶ms);
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ class JsToNativeBridge : public react::ExecutorDelegate {
34
34
return m_registry;
35
35
}
36
36
37
+ bool isBatchActive () {
38
+ return m_batchHadNativeModuleCalls;
39
+ }
40
+
37
41
void callNativeModules (
38
42
JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) override {
39
43
@@ -215,6 +219,10 @@ bool NativeToJsBridge::isInspectable() {
215
219
return m_executor->isInspectable ();
216
220
}
217
221
222
+ bool NativeToJsBridge::isBatchActive () {
223
+ return m_delegate->isBatchActive ();
224
+ }
225
+
218
226
#ifdef WITH_JSC_MEMORY_PRESSURE
219
227
void NativeToJsBridge::handleMemoryPressure (int pressureLevel) {
220
228
runOnExecutorQueue ([=] (JSExecutor* executor) {
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ class NativeToJsBridge {
102
102
void setGlobalVariable (std::string propName, std::unique_ptr<const JSBigString> jsonValue);
103
103
void * getJavaScriptContext ();
104
104
bool isInspectable ();
105
+ bool isBatchActive ();
105
106
106
107
#ifdef WITH_JSC_MEMORY_PRESSURE
107
108
void handleMemoryPressure (int pressureLevel);
You can’t perform that action at this time.
0 commit comments