mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 12:27:30 -06:00
reslice the output if it's beyond length of 'lim'
This commit is contained in:
parent
28499335ec
commit
5ef24340f7
2 changed files with 84 additions and 109 deletions
8
internal/cache/timeline/timeline.go
vendored
8
internal/cache/timeline/timeline.go
vendored
|
|
@ -29,14 +29,14 @@ import (
|
|||
// on the paging order, the cursor value gets
|
||||
// updated while maintaining the boundary value.
|
||||
func nextPageParams(
|
||||
curLo, curHi string,
|
||||
page *paging.Page,
|
||||
nextLo, nextHi string,
|
||||
order paging.Order,
|
||||
) (lo string, hi string) {
|
||||
) {
|
||||
if order.Ascending() {
|
||||
return nextLo, curHi
|
||||
page.Min.Value = nextLo
|
||||
} else /* i.e. descending */ { //nolint:revive
|
||||
return curLo, nextHi
|
||||
page.Max.Value = nextHi
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue