dep(react-native): update to 0.75.4

This commit is contained in:
Calin-Teodor
2024-10-29 13:05:01 +02:00
committed by Calinteodor
parent ac182c18f9
commit 7ff78313ff
10 changed files with 3250 additions and 2948 deletions

View File

@@ -1,55 +0,0 @@
diff --git a/node_modules/react-native/React/CoreModules/RCTTiming.mm b/node_modules/react-native/React/CoreModules/RCTTiming.mm
index e4f7e15..6f05fb3 100644
--- a/node_modules/react-native/React/CoreModules/RCTTiming.mm
+++ b/node_modules/react-native/React/CoreModules/RCTTiming.mm
@@ -127,13 +127,16 @@ RCT_EXPORT_MODULE()
{
_paused = YES;
_timers = [NSMutableDictionary new];
- _inBackground = NO;
- RCTExecuteOnMainQueue(^{
- if (!self->_inBackground && [RCTSharedApplication() applicationState] == UIApplicationStateBackground) {
- [self appDidMoveToBackground];
- }
+
+ __block BOOL initialInBackground;
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ initialInBackground
+ = [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
+ || [UIDevice currentDevice].proximityState;
});
+ _inBackground = initialInBackground;
+
for (NSString *name in @[
UIApplicationWillResignActiveNotification,
UIApplicationDidEnterBackgroundNotification,
@@ -151,6 +154,11 @@ RCT_EXPORT_MODULE()
name:name
object:nil];
}
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(proximityChanged)
+ name:UIDeviceProximityStateDidChangeNotification
+ object:nil];
}
- (void)dealloc
@@ -187,6 +195,16 @@ RCT_EXPORT_MODULE()
[self startTimers];
}
+- (void)proximityChanged
+{
+ BOOL isClose = [UIDevice currentDevice].proximityState;
+ if (isClose) {
+ [self appDidMoveToBackground];
+ } else {
+ [self appDidMoveToForeground];
+ }
+}
+
- (void)stopTimers
{
if (_inBackground) {