mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Try to fix scrollToIndex out of range
This commit is contained in:
		| @@ -38,12 +38,13 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({ | |||||||
|         if (!scrolled.current) { |         if (!scrolled.current) { | ||||||
|           scrolled.current = true |           scrolled.current = true | ||||||
|           const pointer = findIndex(flattenData, ['id', toot.id]) |           const pointer = findIndex(flattenData, ['id', toot.id]) | ||||||
|           setTimeout(() => { |           pointer > 0 && | ||||||
|             flRef.current?.scrollToIndex({ |             setTimeout(() => { | ||||||
|               index: pointer === -1 ? 0 : pointer, |               flRef.current?.scrollToIndex({ | ||||||
|               viewOffset: 100 |                 index: pointer, | ||||||
|             }) |                 viewOffset: 100 | ||||||
|           }, 500) |               }) | ||||||
|  |             }, 1000) | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     }) |     }) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user