From 3a1be8c041970b98ea6f3ea9aa71b0f8024aaf19 Mon Sep 17 00:00:00 2001
From: Maxime Poulin <code@max-p.me>
Date: Wed, 11 Oct 2023 10:53:18 -0400
Subject: [PATCH] Fix legacy pagination for Subscribed feed (#4030)

This is the fix suggested in #4019

I've manually tested both legacy pagination (`page=2&limit=20`) as well as the new pagination (`cursor_next=XXXXXXX&limit=20`) using the same endpoint as #4019, and both methods appear to work as expected.
---
 crates/db_views/src/post_view.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs
index 87c31d7e5..82e830ac1 100644
--- a/crates/db_views/src/post_view.rs
+++ b/crates/db_views/src/post_view.rs
@@ -629,7 +629,7 @@ impl<'a> PostQuery<'a> {
       },
     };
     let (limit, offset) = limit_and_offset(self.page, self.limit)?;
-    if offset != 0 {
+    if offset != 0 && self.page_after.is_some() {
       return Err(Error::QueryBuilderError(
         "legacy pagination cannot be combined with v2 pagination".into(),
       ));
-- 
GitLab