Skip to content

Commit 2e585f0

Browse files
committed
Reinstate a gutted refreshControl to Animated.FlatList props
Several props are populated on this component, any of them could be causing some sort of Android-specific conflict. Since we _do_ know that this broken when refreshControl was removed, just add it back with no functionality.
1 parent bc43208 commit 2e585f0

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/components/scenes/TransactionListScene.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { EdgeCurrencyWallet, EdgeTokenId, EdgeTokenMap, EdgeTransaction } from 'edge-core-js'
22
import { AssetStatus } from 'edge-info-server'
33
import * as React from 'react'
4-
import { ListRenderItemInfo, View } from 'react-native'
4+
import { ListRenderItemInfo, RefreshControl, View } from 'react-native'
55
import { getVersion } from 'react-native-device-info'
66
import Animated from 'react-native-reanimated'
77

@@ -187,6 +187,23 @@ function TransactionListComponent(props: Props) {
187187
// Renderers
188188
//
189189

190+
/**
191+
* HACK: This `RefreshControl` doesn't actually do anything visually or
192+
* functionally noticeable besides making Android scroll gestures actually
193+
* work for the parent `Animated.FlatList`
194+
*/
195+
const refreshControl = React.useMemo(() => {
196+
return (
197+
<RefreshControl
198+
refreshing={false}
199+
enabled={false}
200+
style={{ opacity: 0 }}
201+
// useHandler isn't needed, since we're already in useMemo:
202+
onRefresh={() => {}}
203+
/>
204+
)
205+
}, [])
206+
190207
const topArea = React.useMemo(() => {
191208
return (
192209
<>
@@ -316,6 +333,9 @@ function TransactionListComponent(props: Props) {
316333
onEndReached={handleScrollEnd}
317334
onScroll={handleScroll}
318335
scrollIndicatorInsets={SCROLL_INDICATOR_INSET_FIX}
336+
// Android scroll gestures break without refreshControl given the
337+
// combination of props we use on this Animated.FlatList.
338+
refreshControl={refreshControl}
319339
/>
320340
</View>
321341
)}

0 commit comments

Comments
 (0)