1
0
mirror of https://github.com/tooot-app/app synced 2025-01-18 12:15:42 +01:00

Try faster append toots

This commit is contained in:
xmflsct 2023-02-17 18:58:43 +01:00
parent 9b0f07fbf1
commit d2eb7156a4

View File

@ -167,11 +167,11 @@ const TimelineRefresh: React.FC<Props> = ({
prevCache.current = res.body.slice(0, -PREV_PER_BATCH) prevCache.current = res.body.slice(0, -PREV_PER_BATCH)
return { return {
...old,
pages: [ pages: [
{ ...res, body: res.body.slice(-PREV_PER_BATCH) }, { ...res, body: res.body.slice(-PREV_PER_BATCH) },
...old.pages.slice(0, keepPagesCount) ...old.pages.slice(0, keepPagesCount)
], ]
pageParams: [{}, ...old.pageParams.slice(0, keepPagesCount)]
} }
}) })
@ -189,7 +189,7 @@ const TimelineRefresh: React.FC<Props> = ({
flRef.current?.scrollToOffset({ offset: scrollY.value - 15, animated: true }) flRef.current?.scrollToOffset({ offset: scrollY.value - 15, animated: true })
} }
await new Promise<void>(promise => setTimeout(promise, 64)) await new Promise<void>(promise => setTimeout(promise, 16))
queryClient.setQueryData< queryClient.setQueryData<
InfiniteData< InfiniteData<
PagedResponse<(Mastodon.Status | Mastodon.Notification | Mastodon.Conversation)[]> PagedResponse<(Mastodon.Status | Mastodon.Notification | Mastodon.Conversation)[]>