mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 22:22:25 -05:00
[bugfix] more robust list timeline invalidation (#1995)
This commit is contained in:
parent
346ecabd07
commit
f4319740ab
15 changed files with 254 additions and 226 deletions
|
|
@ -116,25 +116,17 @@ func (p *Processor) HomeTimelineGet(ctx context.Context, authed *oauth.Auth, max
|
|||
|
||||
var (
|
||||
items = make([]interface{}, count)
|
||||
nextMaxIDValue string
|
||||
prevMinIDValue string
|
||||
nextMaxIDValue = statuses[count-1].GetID()
|
||||
prevMinIDValue = statuses[0].GetID()
|
||||
)
|
||||
|
||||
for i, item := range statuses {
|
||||
if i == count-1 {
|
||||
nextMaxIDValue = item.GetID()
|
||||
}
|
||||
|
||||
if i == 0 {
|
||||
prevMinIDValue = item.GetID()
|
||||
}
|
||||
|
||||
items[i] = item
|
||||
for i := range statuses {
|
||||
items[i] = statuses[i]
|
||||
}
|
||||
|
||||
return util.PackagePageableResponse(util.PageableResponseParams{
|
||||
Items: items,
|
||||
Path: "api/v1/timelines/home",
|
||||
Path: "/api/v1/timelines/home",
|
||||
NextMaxIDValue: nextMaxIDValue,
|
||||
PrevMinIDValue: prevMinIDValue,
|
||||
Limit: limit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue