mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Refine remote logic
When loading remote ancestors, the position might not be kept
This commit is contained in:
@@ -111,7 +111,8 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
||||
}
|
||||
)
|
||||
|
||||
flRef.current?.props.data?.length && setTimeout(() => {
|
||||
flRef.current?.props.data?.length &&
|
||||
setTimeout(() => {
|
||||
flRef.current?.scrollToIndex({
|
||||
index: ancestorsCache.current?.length || 0,
|
||||
viewOffset: 50
|
||||
@@ -236,14 +237,8 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
||||
return
|
||||
}
|
||||
|
||||
if ((query.data?.pages[0].body.length || 0) <= data.length) {
|
||||
if (
|
||||
!hasRemoteContent &&
|
||||
(query.data?.pages[0].body.length || 0) <= data.length &&
|
||||
data.length > 1
|
||||
) {
|
||||
if ((query.data?.pages[0].body.length || 0) < data.length) {
|
||||
setHasRemoteContent(true)
|
||||
}
|
||||
|
||||
queryClient.cancelQueries(queryKey.local)
|
||||
queryClient.setQueryData<{ pages: { body: Mastodon.Status[] }[] }>(
|
||||
|
Reference in New Issue
Block a user