1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Reply working

This commit is contained in:
Zhiyuan Zheng
2020-12-13 01:24:25 +01:00
parent f0daae30cd
commit cfd2d40d02
13 changed files with 346 additions and 180 deletions

View File

@ -50,6 +50,7 @@ const Timeline: React.FC<Props> = ({
}
]
const {
status,
isSuccess,
isLoading,
isError,
@ -109,14 +110,8 @@ const Timeline: React.FC<Props> = ({
[]
)
const flItemEmptyComponent = useMemo(
() => (
<TimelineEmpty
isLoading={isLoading}
isError={isError}
refetch={refetch}
/>
),
[isLoading, isError]
() => <TimelineEmpty status={status} refetch={refetch} />,
[isLoading, isError, isSuccess]
)
const flOnRefresh = useCallback(
() =>
@ -124,7 +119,7 @@ const Timeline: React.FC<Props> = ({
fetchMore(
{
direction: 'prev',
id: flattenData[0].id
id: flattenData.length ? flattenData[0].id : null
},
{ previous: true }
),
@ -142,11 +137,6 @@ const Timeline: React.FC<Props> = ({
)
const flFooter = useCallback(() => {
return <TimelineEnd isFetchingMore={isFetchingMore} />
// if (isFetchingMore) {
// return <ActivityIndicator />
// } else {
// return <TimelineEnd />
// }
}, [isFetchingMore])
const onScrollToIndexFailed = useCallback(error => {
const offset = error.averageItemLength * error.index