From f1aeee4933f2befbb330cdf10089baf698edc921 Mon Sep 17 00:00:00 2001 From: Eric Andrews Date: Thu, 21 Dec 2023 14:57:16 -0500 Subject: [PATCH] applied cursor pagination hotfix --- Mlem/API/Requests/Post/GetPosts.swift | 2 +- Mlem/Models/Trackers/Post Tracker.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mlem/API/Requests/Post/GetPosts.swift b/Mlem/API/Requests/Post/GetPosts.swift index 52b652881..3aa41ab7b 100644 --- a/Mlem/API/Requests/Post/GetPosts.swift +++ b/Mlem/API/Requests/Post/GetPosts.swift @@ -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)") } diff --git a/Mlem/Models/Trackers/Post Tracker.swift b/Mlem/Models/Trackers/Post Tracker.swift index caf1e74af..77293588a 100644 --- a/Mlem/Models/Trackers/Post Tracker.swift +++ b/Mlem/Models/Trackers/Post Tracker.swift @@ -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 }