From fa641ec2b2f9279177c33f88655faf6f483f78ec Mon Sep 17 00:00:00 2001 From: Tony Li Date: Thu, 19 Oct 2023 11:05:40 +1300 Subject: [PATCH] Allow fetching post in empty range which means returning unlimited result --- WordPress/Classes/Services/PostRepository.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/Services/PostRepository.swift b/WordPress/Classes/Services/PostRepository.swift index ada392e60d46..51fb8f7562d0 100644 --- a/WordPress/Classes/Services/PostRepository.swift +++ b/WordPress/Classes/Services/PostRepository.swift @@ -319,7 +319,7 @@ extension PostRepository { type: type, statuses: statuses, authorUserID: authorUserID, - range: offset...(offset + max(number - 1, 0)), + range: offset..<(offset + max(number, 0)), orderBy: .byDate, descending: true, // Only delete other local posts if the current call is the first pagination request. @@ -355,7 +355,7 @@ extension PostRepository { searchInput: input, statuses: statuses, authorUserID: authorUserID, - range: 0...max(limit - 1, 0), + range: 0.., + range: Range, orderBy: PostServiceResultsOrdering = .byDate, descending: Bool = true, deleteOtherLocalPosts: Bool,