mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at schema-errors 69 lines 2.4 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..1ecdf0a 100644 3--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h 4+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.h 5@@ -16,4 +16,6 @@ 6 @property (nonatomic, copy) RCTDirectEventBlock onRefresh; 7 @property (nonatomic, weak) UIScrollView *scrollView; 8 9+- (void)forwarderBeginRefreshing; 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 b09e653..4c32b31 100644 14--- a/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 15+++ b/node_modules/react-native/React/Views/RefreshControl/RCTRefreshControl.m 16@@ -198,9 +198,53 @@ - (void)refreshControlValueChanged 17 [self setCurrentRefreshingState:super.refreshing]; 18 _refreshingProgrammatically = NO; 19 20+ if (@available(iOS 17.4, *)) { 21+ if (_currentRefreshingState) { 22+ UIImpactFeedbackGenerator *feedbackGenerator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight]; 23+ [feedbackGenerator prepare]; 24+ [feedbackGenerator impactOccurred]; 25+ } 26+ } 27+ 28 if (_onRefresh) { 29 _onRefresh(nil); 30 } 31 } 32 33+/* 34+ This method is used by Bluesky's ExpoScrollForwarder. This allows other React Native 35+ libraries to perform a refresh of a scrollview and access the refresh control's onRefresh 36+ function. 37+ */ 38+- (void)forwarderBeginRefreshing 39+{ 40+ _refreshingProgrammatically = NO; 41+ 42+ [self sizeToFit]; 43+ 44+ if (!self.scrollView) { 45+ return; 46+ } 47+ 48+ UIScrollView *scrollView = (UIScrollView *)self.scrollView; 49+ 50+ [UIView animateWithDuration:0.3 51+ delay:0 52+ options:UIViewAnimationOptionBeginFromCurrentState 53+ animations:^(void) { 54+ // Whenever we call this method, the scrollview will always be at a position of 55+ // -130 or less. Scrolling back to -65 simulates the default behavior of RCTRefreshControl 56+ [scrollView setContentOffset:CGPointMake(0, -65)]; 57+ } 58+ completion:^(__unused BOOL finished) { 59+ [super beginRefreshing]; 60+ [self setCurrentRefreshingState:super.refreshing]; 61+ 62+ if (self->_onRefresh) { 63+ self->_onRefresh(nil); 64+ } 65+ } 66+ ]; 67+} 68+ 69 @end