mirror of
https://github.com/tooot-app/app
synced 2025-01-31 10:44:58 +01:00
Fixed #321
This commit is contained in:
parent
dcfc87a2d3
commit
6f414d38be
@ -5,18 +5,11 @@ import { getInstanceActive } from '@utils/slices/instancesSlice'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React, { RefObject, useCallback, useRef } from 'react'
|
||||
import {
|
||||
FlatList,
|
||||
FlatListProps,
|
||||
Platform,
|
||||
RefreshControl,
|
||||
StyleSheet
|
||||
} from 'react-native'
|
||||
import { FlatList, FlatListProps, Platform, RefreshControl } from 'react-native'
|
||||
import Animated, {
|
||||
useAnimatedScrollHandler,
|
||||
useSharedValue
|
||||
} from 'react-native-reanimated'
|
||||
import { useQueryClient } from 'react-query'
|
||||
import { useSelector } from 'react-redux'
|
||||
import TimelineEmpty from './Timeline/Empty'
|
||||
import TimelineFooter from './Timeline/Footer'
|
||||
@ -149,7 +142,6 @@ const Timeline: React.FC<Props> = ({
|
||||
data={flattenData}
|
||||
initialNumToRender={6}
|
||||
maxToRenderPerBatch={3}
|
||||
style={styles.flatList}
|
||||
onEndReached={onEndReached}
|
||||
onEndReachedThreshold={0.75}
|
||||
ListFooterComponent={
|
||||
@ -160,9 +152,13 @@ const Timeline: React.FC<Props> = ({
|
||||
}
|
||||
ListEmptyComponent={<TimelineEmpty queryKey={queryKey} />}
|
||||
ItemSeparatorComponent={ItemSeparatorComponent}
|
||||
maintainVisibleContentPosition={{
|
||||
minIndexForVisible: 0
|
||||
}}
|
||||
maintainVisibleContentPosition={
|
||||
isFetching
|
||||
? {
|
||||
minIndexForVisible: 0
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
{...androidRefreshControl}
|
||||
{...customProps}
|
||||
/>
|
||||
@ -170,10 +166,4 @@ const Timeline: React.FC<Props> = ({
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
flatList: {
|
||||
minHeight: '100%'
|
||||
}
|
||||
})
|
||||
|
||||
export default Timeline
|
||||
|
Loading…
x
Reference in New Issue
Block a user