diff --git a/src/components/Timeline.tsx b/src/components/Timeline.tsx index c485485f..bc9d8f59 100644 --- a/src/components/Timeline.tsx +++ b/src/components/Timeline.tsx @@ -128,6 +128,7 @@ const Timeline: React.FC = ({ return ( <> > queryKey: QueryKeyTimeline scrollY: Animated.SharedValue fetchingType: Animated.SharedValue<0 | 1 | 2> @@ -40,6 +41,7 @@ export const SEPARATION_Y_2 = -( ) const TimelineRefresh: React.FC = ({ + flRef, queryKey, scrollY, fetchingType, @@ -137,6 +139,10 @@ const TimelineRefresh: React.FC = ({ } ) } + const callRefetch = async () => { + await refetch() + setTimeout(() => flRef.current?.scrollToOffset({ offset: 1 }), 50) + } const [textRight, setTextRight] = useState(0) const arrowY = useAnimatedStyle(() => ({ @@ -225,7 +231,7 @@ const TimelineRefresh: React.FC = ({ break case 2: runOnJS(prepareRefetch)() - runOnJS(refetch)() + runOnJS(callRefetch)() break } },