mirror of
https://github.com/tooot-app/app
synced 2025-03-12 09:30:11 +01:00
Refetch only latest pages
This commit is contained in:
parent
d1714fab26
commit
90b0178f5d
@ -223,6 +223,18 @@ const TimelineRefresh: React.FC<Props> = ({
|
||||
if (readMarker) {
|
||||
setAccountStorage([{ key: readMarker, value: undefined }])
|
||||
}
|
||||
queryClient.setQueryData<
|
||||
InfiniteData<
|
||||
PagedResponse<(Mastodon.Status | Mastodon.Notification | Mastodon.Conversation)[]>
|
||||
>
|
||||
>(queryKey, old => {
|
||||
if (!old) return old
|
||||
|
||||
return {
|
||||
pages: [old.pages[0]],
|
||||
pageParams: [old.pageParams[0]]
|
||||
}
|
||||
})
|
||||
await refetch()
|
||||
setTimeout(() => flRef.current?.scrollToOffset({ offset: 0 }), 50)
|
||||
}
|
||||
|
@ -131,9 +131,9 @@ const Timeline: React.FC<Props> = ({
|
||||
|
||||
const firstItemId = viewableItems.filter(item => item.isViewable)[0]?.item.id
|
||||
if (!fetchingActive.current && firstItemId && firstItemId > (marker || '0')) {
|
||||
// setAccountStorage([{ key: readMarker, value: firstItemId }])
|
||||
setAccountStorage([{ key: readMarker, value: firstItemId }])
|
||||
} else {
|
||||
setAccountStorage([{ key: readMarker, value: '109519141378761752' }])
|
||||
// setAccountStorage([{ key: readMarker, value: '109519141378761752' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user