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