Remove Segment (#5518)

This commit is contained in:
Hailey
2024-09-27 14:01:57 -07:00
committed by GitHub
parent bcd096b85a
commit f68b15219f
59 changed files with 221 additions and 1988 deletions
+2 -7
View File
@@ -10,7 +10,6 @@ import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useQueryClient} from '@tanstack/react-query'
import {useAnalytics} from '#/lib/analytics/analytics'
import {cleanError} from '#/lib/strings/errors'
import {logger} from '#/logger'
import {isNative, isWeb} from '#/platform/detection'
@@ -48,7 +47,6 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
ref,
) {
const t = useTheme()
const {track} = useAnalytics()
const {_} = useLingui()
const [isPTRing, setIsPTRing] = React.useState(false)
const opts = React.useMemo(() => ({enabled}), [enabled])
@@ -102,7 +100,6 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
}))
const onRefresh = React.useCallback(async () => {
track('Lists:onRefresh')
setIsPTRing(true)
try {
await refetch()
@@ -110,18 +107,16 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
logger.error('Failed to refresh lists', {message: err})
}
setIsPTRing(false)
}, [refetch, track, setIsPTRing])
}, [refetch, setIsPTRing])
const onEndReached = React.useCallback(async () => {
if (isFetching || !hasNextPage || isError) return
track('Lists:onEndReached')
try {
await fetchNextPage()
} catch (err) {
logger.error('Failed to load more lists', {message: err})
}
}, [isFetching, hasNextPage, isError, fetchNextPage, track])
}, [isFetching, hasNextPage, isError, fetchNextPage])
const onPressRetryLoadMore = React.useCallback(() => {
fetchNextPage()