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

Using tab-view

Cannot scroll separately
This commit is contained in:
Zhiyuan Zheng
2020-12-17 09:44:03 +01:00
parent a3335a1f88
commit 3427b613aa
15 changed files with 462 additions and 173 deletions

View File

@ -91,26 +91,53 @@ export const timelineFetch = async (
return Promise.resolve({ toots: res.body })
case 'Account_Default':
res = await client({
method: 'get',
instance: 'local',
url: `accounts/${account}/statuses`,
params: {
pinned: 'true'
if (pagination && pagination.id) {
if (pagination.direction === 'prev') {
res = await client({
method: 'get',
instance: 'local',
url: `accounts/${account}/statuses`,
params: {
pinned: 'true',
...params
}
})
return Promise.resolve({ toots: res.body })
} else {
res = await client({
method: 'get',
instance: 'local',
url: `accounts/${account}/statuses`,
params: {
exclude_replies: 'true',
...params
}
})
return Promise.resolve({ toots: res.body })
}
})
const pinnedLength = res.body.length
let toots: Mastodon.Status[] = res.body
res = await client({
method: 'get',
instance: 'local',
url: `accounts/${account}/statuses`,
params: {
exclude_replies: 'true'
}
})
toots = uniqBy([...toots, ...res.body], 'id')
return Promise.resolve({ toots: toots, pinnedLength })
} else {
res = await client({
method: 'get',
instance: 'local',
url: `accounts/${account}/statuses`,
params: {
pinned: 'true'
}
})
const pinnedLength = res.body.length
let toots: Mastodon.Status[] = res.body
res = await client({
method: 'get',
instance: 'local',
url: `accounts/${account}/statuses`,
params: {
exclude_replies: 'true'
}
})
toots = uniqBy([...toots, ...res.body], 'id')
return Promise.resolve({ toots: toots, pinnedLength })
}
break
case 'Account_All':
res = await client({