1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Scroll to toot working

This commit is contained in:
Zhiyuan Zheng
2020-12-12 12:49:29 +01:00
parent 0fa9f87f66
commit 81a21d1d07
13 changed files with 140 additions and 116 deletions

View File

@ -12,14 +12,14 @@ export const timelineFetch = async (
list,
toot
}: {
page: string
page: App.Pages
params?: {
[key: string]: string | number | boolean
}
account?: string
hashtag?: string
list?: string
toot?: string
hashtag?: Mastodon.Tag['name']
list?: Mastodon.List['id']
toot?: Mastodon.Status
account?: Mastodon.Account['id']
},
pagination: {
direction: 'prev' | 'next'
@ -173,23 +173,14 @@ export const timelineFetch = async (
return Promise.resolve({ toots: res.body, pointer: null })
case 'Toot':
const current = await client({
res = await client({
method: 'get',
instance: 'local',
url: `statuses/${toot}`
})
const context = await client({
method: 'get',
instance: 'local',
url: `statuses/${toot}/context`
url: `statuses/${toot!.id}/context`
})
return Promise.resolve({
toots: [
...context.body.ancestors,
current.body,
...context.body.descendants
],
pointer: context.body.ancestors.length
toots: [...res.body.ancestors, toot, ...res.body.descendants],
pointer: res.body.ancestors.length
})
default: