From 89dcf742f471f26424664cc705f95fb2fd5a1da7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 14 Apr 2019 11:09:07 +0300 Subject: Fix search paging --- src/main/java/com/juick/server/www/controllers/MessagesWWW.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/juick/server/www/controllers/MessagesWWW.java b/src/main/java/com/juick/server/www/controllers/MessagesWWW.java index 5d82b686..aa79ee0e 100644 --- a/src/main/java/com/juick/server/www/controllers/MessagesWWW.java +++ b/src/main/java/com/juick/server/www/controllers/MessagesWWW.java @@ -177,7 +177,9 @@ public class MessagesWWW { model.addAttribute("showAdv", paramShow == null && paramBefore == 0 && paramSearch == null && visitor.isAnonymous()); if (mids.size() >= 20) { - String nextpage = (paramShow == null) ? "?to=" + msgs.get(msgs.size() - 1).getUpdated().toEpochMilli() : paramSearch != null ? String.format("?page=%d", page + 1) : "?before=" + mids.get(mids.size() - 1); + String nextpage = paramSearch != null ? String.format("?page=%d", page + 1) + : (paramShow == null) ? "?to=" + msgs.get(msgs.size() - 1).getUpdated().toEpochMilli() + : "?before=" + mids.get(mids.size() - 1); if (paramShow != null) { nextpage += "&show=" + paramShow; } -- cgit v1.2.3