Bluesky app fork with some witchin' additions 馃挮
at main 3.0 kB view raw
1diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h 2index e9b330f..5fbb2e0 100644 3--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h 4+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h 5@@ -15,5 +15,6 @@ 6 @property (nonatomic, copy) NSString *title; 7 @property (nonatomic, copy) RCTDirectEventBlock onRefresh; 8 @property (nonatomic, weak) UIScrollView *scrollView; 9+@property (nonatomic, copy) UIColor *customTintColor; 10 11 @end 12diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 13index 53bfd04..e2e0c9f 100644 14--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 15+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 16@@ -23,6 +23,7 @@ @implementation RCTRefreshControl { 17 UIColor *_titleColor; 18 CGFloat _progressViewOffset; 19 BOOL _hasMovedToWindow; 20+ UIColor *_customTintColor; 21 } 22 23 - (instancetype)init 24@@ -58,6 +59,12 @@ - (void)layoutSubviews 25 _isInitialRender = false; 26 } 27 28+- (void)didMoveToSuperview 29+{ 30+ [super didMoveToSuperview]; 31+ [self setTintColor:_customTintColor]; 32+} 33+ 34 - (void)didMoveToWindow 35 { 36 [super didMoveToWindow]; 37@@ -221,4 +228,16 @@ - (void)refreshControlValueChanged 38 } 39 } 40 41+// Fix for https://github.com/facebook/react-native/issues/43388 42+// A bug in iOS 17.4 causes the haptic to not play when refreshing if the tintColor 43+// is set before the refresh control gets added to the scrollview. We'll call this 44+// function whenever the superview changes. We'll also call it if the value of customTintColor 45+// changes. 46+- (void)setTintColor:(UIColor *)tintColor 47+{ 48+ if ([self.superview isKindOfClass:[UIScrollView class]] && self.tintColor != tintColor) { 49+ [super setTintColor:tintColor]; 50+ } 51+} 52+ 53 @end 54diff --git a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m 55index 40aaf9c..1c60164 100644 56--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m 57+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m 58@@ -22,11 +22,12 @@ - (UIView *)view 59 60 RCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock) 61 RCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL) 62-RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) 63 RCT_EXPORT_VIEW_PROPERTY(title, NSString) 64 RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) 65 RCT_EXPORT_VIEW_PROPERTY(progressViewOffset, CGFloat) 66 67+RCT_REMAP_VIEW_PROPERTY(tintColor, customTintColor, UIColor) 68+ 69 RCT_EXPORT_METHOD(setNativeRefreshing : (nonnull NSNumber *)viewTag toRefreshing : (BOOL)refreshing) 70 { 71 [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {