mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 11:22:25 -05:00
[bugfix] fix lo paging value not always being set (#4407)
the "lo" paging value wasn't always being set when loading statuses from the database. this seems to (potentially) fix an issue in tusky with list timelines showing repeated posts. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4407 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
78defcd916
commit
ed3035699f
1 changed files with 6 additions and 3 deletions
9
internal/cache/timeline/status.go
vendored
9
internal/cache/timeline/status.go
vendored
|
|
@ -479,9 +479,6 @@ func loadStatusTimeline(
|
|||
// limit of total we're expected to return.
|
||||
nextPg.Limit = returnLimit - len(apiStatuses)
|
||||
if nextPg.Limit <= 0 {
|
||||
|
||||
// We reached the end! Set lo paging value.
|
||||
lo = apiStatuses[len(apiStatuses)-1].ID
|
||||
break
|
||||
}
|
||||
|
||||
|
|
@ -533,6 +530,12 @@ func loadStatusTimeline(
|
|||
)
|
||||
}
|
||||
|
||||
if len(apiStatuses) > 0 {
|
||||
// We finished loading statuses with
|
||||
// values to return, set lo paging value.
|
||||
lo = apiStatuses[len(apiStatuses)-1].ID
|
||||
}
|
||||
|
||||
return apiStatuses, lo, hi, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue