Skip to content

Commit 2057ab3

Browse files
committed
fix: revert upgrade changes
1 parent 8a9060a commit 2057ab3

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

ios/RNCSafeAreaProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
1414
- (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher NS_DESIGNATED_INITIALIZER;
1515

1616
// NOTE: currently these event props are only declared so we can export the
17-
// event names to JS - we don't call the blocks directly because scroll events
17+
// event names to JS - we don't call the blocks directly because events
1818
// need to be coalesced before sending, for performance reasons.
1919
@property (nonatomic, copy) RCTBubblingEventBlock onInsetsChange;
2020

ios/RNCSafeAreaProvider.m

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDis
2424
RCTAssertParam(eventDispatcher);
2525

2626
if ((self = [super initWithFrame:CGRectZero])) {
27-
#if !TARGET_OS_TV
27+
#if !TARGET_OS_TV && !TARGET_OS_OSX
2828

2929
_eventDispatcher = eventDispatcher;
3030

@@ -62,28 +62,28 @@ - (void)invalidateSafeAreaInsets
6262
return;
6363
}
6464

65-
#if TARGET_OS_IPHONE
66-
UIEdgeInsets safeAreaInsets = self.safeAreaInsets;
67-
#elif TARGET_OS_OSX
68-
NSEdgeInsets safeAreaInsets;
69-
if (@available(macOS 11.0, *)) {
70-
safeAreaInsets = self.safeAreaInsets;
71-
} else {
72-
safeAreaInsets = NSEdgeInsetsZero;
73-
}
74-
#endif
65+
#if TARGET_OS_IPHONE
66+
UIEdgeInsets safeAreaInsets = self.safeAreaInsets;
67+
#elif TARGET_OS_OSX
68+
NSEdgeInsets safeAreaInsets;
69+
if (@available(macOS 11.0, *)) {
70+
safeAreaInsets = self.safeAreaInsets;
71+
} else {
72+
safeAreaInsets = NSEdgeInsetsZero;
73+
}
74+
#endif
7575

7676
CGRect frame = [self convertRect:self.bounds toView:RNCParentViewController(self).view];
7777

7878
if (_initialInsetsSent &&
79-
#if TARGET_OS_IPHONE
80-
UIEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale()) &&
81-
#elif TARGET_OS_OSX
82-
NSEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale()) &&
83-
#endif
84-
CGRectEqualToRect(frame, _currentFrame)) {
85-
return;
86-
}
79+
#if TARGET_OS_IPHONE
80+
UIEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale()) &&
81+
#elif TARGET_OS_OSX
82+
NSEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale()) &&
83+
#endif
84+
CGRectEqualToRect(frame, _currentFrame)) {
85+
return;
86+
}
8787

8888
_initialInsetsSent = YES;
8989
_currentSafeAreaInsets = safeAreaInsets;

0 commit comments

Comments
 (0)