forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path@react-native+virtualized-lists+0.75.2+001+onStartReched.patch
32 lines (30 loc) · 1.39 KB
/
@react-native+virtualized-lists+0.75.2+001+onStartReched.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
index 0516679..e338d90 100644
--- a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
+++ b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
@@ -1546,7 +1546,7 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
// Next check if the user just scrolled within the start threshold
// and call onStartReached only once for a given content length,
// and only if onEndReached is not being executed
- else if (
+ if (
onStartReached != null &&
this.state.cellsAroundViewport.first === 0 &&
isWithinStartThreshold &&
@@ -1558,13 +1558,11 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
// If the user scrolls away from the start or end and back again,
// cause onStartReached or onEndReached to be triggered again
- else {
- this._sentStartForContentLength = isWithinStartThreshold
- ? this._sentStartForContentLength
- : 0;
- this._sentEndForContentLength = isWithinEndThreshold
- ? this._sentEndForContentLength
- : 0;
+ if (!isWithinStartThreshold) {
+ this._sentStartForContentLength = 0;
+ }
+ if (!isWithinEndThreshold) {
+ this._sentEndForContentLength = 0;
}
}