diff options
author | 2023-07-18 09:43:17 +0100 | |
---|---|---|
committer | 2023-07-18 09:43:17 +0100 | |
commit | f4319740ab02d680961781861335285f618f5f48 (patch) | |
tree | 133595a10ec93cce9da269a4fa671c226bab7298 /internal/processing/timeline/home.go | |
parent | [bugfix] Add missing `continue` statement in `prepareXBetweenIDs` (#1996) (diff) | |
download | gotosocial-f4319740ab02d680961781861335285f618f5f48.tar.xz |
[bugfix] more robust list timeline invalidation (#1995)v0.10.0-rc3
Diffstat (limited to 'internal/processing/timeline/home.go')
-rw-r--r-- | internal/processing/timeline/home.go | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/internal/processing/timeline/home.go b/internal/processing/timeline/home.go index 807189495..72940175f 100644 --- a/internal/processing/timeline/home.go +++ b/internal/processing/timeline/home.go @@ -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, |