Skip to content

Commit

Permalink
applied cursor pagination hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews committed Dec 21, 2023
1 parent b11b9ea commit f1aeee4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mlem/API/Requests/Post/GetPosts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct GetPostsRequest: APIGetRequest {

let paginationParameter: URLQueryItem
if let cursor {
paginationParameter = .init(name: "page_v2", value: cursor)
paginationParameter = .init(name: "page_cursor", value: cursor)
} else {
paginationParameter = .init(name: "page", value: "\(page)")
}
Expand Down
2 changes: 1 addition & 1 deletion Mlem/Models/Trackers/Post Tracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class PostTracker: ObservableObject {
let thresholdIndex = max(0, items.index(items.endIndex, offsetBy: AppConstants.infiniteLoadThresholdOffset))
if thresholdIndex >= 0,
let itemIndex = items.firstIndex(where: { $0.uid == item.uid }),
itemIndex >= thresholdIndex {
itemIndex == thresholdIndex {
return true
}

Expand Down

0 comments on commit f1aeee4

Please sign in to comment.