Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-native/React/Base/RCTUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,13 @@ UIDeviceOrientation RCTDeviceOrientation(void)
CGSize RCTScreenSize(void)
{
static CGSize portraitSize;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{

if (CGSizeEqualToSize(portraitSize, CGSizeZero)) {
RCTUnsafeExecuteOnMainQueueSync(^{
CGSize screenSize = [UIScreen mainScreen].bounds.size;
portraitSize = CGSizeMake(MIN(screenSize.width, screenSize.height), MAX(screenSize.width, screenSize.height));
});
});
}

#if !TARGET_OS_TV
if (UIDeviceOrientationIsLandscape(RCTDeviceOrientation())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ - (UIWindow *)alertWindow
UIWindowScene *scene = RCTKeyWindow().windowScene;
if (scene != nil) {
_alertWindow = [[UIWindow alloc] initWithWindowScene:scene];
_alertWindow.frame = scene.coordinateSpace.bounds;
} else {
_alertWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
}
Expand Down
Loading