diff --git a/src/components/Timeline/Refresh.tsx b/src/components/Timeline/Refresh.tsx index 1a183df4..d401d8d4 100644 --- a/src/components/Timeline/Refresh.tsx +++ b/src/components/Timeline/Refresh.tsx @@ -61,7 +61,7 @@ const TimelineRefresh: React.FC = ({ const prevStatusId = useRef() const queryClient = useQueryClient() - const { refetch } = useTimelineQuery({ ...queryKey[1] }) + const { refetch, isFetched } = useTimelineQuery({ ...queryKey[1] }) const { t } = useTranslation('componentTimeline') const { colors } = useTheme() @@ -118,10 +118,11 @@ const TimelineRefresh: React.FC = ({ } }, data => { - if (data) { + if (data && isFetched) { runOnJS(haptics)('Light') } - } + }, + [isFetched] ) const fetchAndScrolled = useSharedValue(false) @@ -246,6 +247,8 @@ const TimelineRefresh: React.FC = ({ [] ) + if (!isFetched) return null + return ( = ({ ) } viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs.current} - {...(!isLoading && { - maintainVisibleContentPosition: { - minIndexForVisible: 0 - } - })} + {...(!isLoading && + !isFetching && { + maintainVisibleContentPosition: { + minIndexForVisible: 0 + } + })} {...androidRefreshControl} {...customProps} />