Skip to content

Commit be4d231

Browse files
committed
chore: sync with upstream
1 parent ea71d44 commit be4d231

File tree

3 files changed

+146
-170
lines changed

3 files changed

+146
-170
lines changed

packages/react-native/React/CoreModules/RCTDeviceInfo.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ - (void)initialize
6060
selector:@selector(interfaceOrientationDidChange)
6161
name:UIApplicationDidChangeStatusBarOrientationNotification
6262
object:nil];
63+
#endif
6364

6465
_currentInterfaceDimensions = [self _exportedDimensions];
6566

@@ -77,10 +78,13 @@ - (void)initialize
7778
selector:@selector(interfaceFrameDidChange)
7879
name:RCTWindowFrameDidChangeNotification
7980
object:nil];
81+
#if !TARGET_OS_VISION
8082
[[NSNotificationCenter defaultCenter] addObserver:self
8183
selector:@selector(interfaceFrameDidChange)
8284
name:UIDeviceOrientationDidChangeNotification
8385
object:nil];
86+
#endif
87+
8488

8589
// TODO T175901725 - Registering the RCTDeviceInfo module to the notification is a short-term fix to unblock 0.73
8690
// The actual behavior should be that the module is properly registered in the TurboModule/Bridge infrastructure
@@ -120,7 +124,9 @@ - (void)_cleanupObservers
120124

121125
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];
122126

127+
#if !TARGET_OS_VISION
123128
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
129+
#endif
124130
}
125131

126132
static BOOL RCTIsIPhoneNotched()

0 commit comments

Comments
 (0)