mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Improve marker loading
Actually the id can be invalid (not found), and the timeline can be loaded to the right position, therefore no need to check the id anymore.
This commit is contained in:
@ -61,20 +61,9 @@ export const queryFunctionTimeline = async ({
|
||||
|
||||
let marker: string | undefined
|
||||
if (page.page === 'Following' && !pageParam?.offset && !pageParam?.min_id && !pageParam?.max_id) {
|
||||
const storedMarker = getAccountStorage.string('read_marker_following')
|
||||
if (storedMarker) {
|
||||
await apiInstance<Mastodon.Status[]>({
|
||||
method: 'get',
|
||||
url: 'timelines/home',
|
||||
params: { limit: 1, min_id: storedMarker }
|
||||
}).then(res => {
|
||||
if (res.body.length) {
|
||||
marker = storedMarker
|
||||
}
|
||||
})
|
||||
}
|
||||
marker = getAccountStorage.string('read_marker_following')
|
||||
}
|
||||
let params: { [key: string]: string } = marker
|
||||
const params: { [key: string]: string } = marker
|
||||
? { limit: 40, max_id: marker }
|
||||
: { limit: 40, ...pageParam }
|
||||
|
||||
|
Reference in New Issue
Block a user