mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Improve refresh loading
This commit is contained in:
		| @@ -61,7 +61,7 @@ const TimelineRefresh: React.FC<Props> = ({ | ||||
|   const prevStatusId = useRef<Mastodon.Status['id']>() | ||||
|  | ||||
|   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<Props> = ({ | ||||
|       } | ||||
|     }, | ||||
|     data => { | ||||
|       if (data) { | ||||
|       if (data && isFetched) { | ||||
|         runOnJS(haptics)('Light') | ||||
|       } | ||||
|     } | ||||
|     }, | ||||
|     [isFetched] | ||||
|   ) | ||||
|  | ||||
|   const fetchAndScrolled = useSharedValue(false) | ||||
| @@ -246,6 +247,8 @@ const TimelineRefresh: React.FC<Props> = ({ | ||||
|     [] | ||||
|   ) | ||||
|  | ||||
|   if (!isFetched) return null | ||||
|  | ||||
|   return ( | ||||
|     <Animated.View | ||||
|       style={{ | ||||
|   | ||||
| @@ -228,7 +228,8 @@ const Timeline: React.FC<Props> = ({ | ||||
|           ) | ||||
|         } | ||||
|         viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs.current} | ||||
|         {...(!isLoading && { | ||||
|         {...(!isLoading && | ||||
|           !isFetching && { | ||||
|             maintainVisibleContentPosition: { | ||||
|               minIndexForVisible: 0 | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user