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

Rewrite timeline pagination

Using Link in returned headers instead. Also, `since_id` is not the correct way to refresh. See https://mastodonpy.readthedocs.io/en/stable/index.html?highlight=pagination#a-note-about-pagination
This commit is contained in:
Zhiyuan Zheng
2020-10-29 23:06:25 +01:00
parent 9c30edcc65
commit 2ab227a370
4 changed files with 130 additions and 79 deletions

View File

@ -23,10 +23,10 @@ export async function client (url, query, { body, ...customConfig } = {}) {
let data
try {
const response = await fetch(`https://${url}${queryString}`, config)
const response = await fetch(`${url}${queryString}`, config)
data = await response.json()
if (response.ok) {
return data
return { headers: response.headers, body: data }
}
throw new Error(response.statusText)
} catch (err) {