From 0c9f2df5fd8f473d767f2e8993a49d486add1275 Mon Sep 17 00:00:00 2001 From: Ryan Stafford Date: Sat, 20 Jul 2024 12:33:59 -0400 Subject: [PATCH] only override commentsort on post page. fixes #107 --- routes.go | 3 +++ state.go | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/routes.go b/routes.go index 2d498ba..bcdccd6 100644 --- a/routes.go +++ b/routes.go @@ -630,6 +630,9 @@ func GetPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { Render(w, "block.html", state) return } + if len(m["sort"]) > 0 { + state.CommentSort = m["sort"][0] + } state.GetComments() Render(w, "index.html", state) } diff --git a/state.go b/state.go index 94ee947..1a2e5dc 100644 --- a/state.go +++ b/state.go @@ -220,7 +220,6 @@ func (state *State) ParseQuery(RawQuery string) { } if len(m["sort"]) > 0 { state.Sort = m["sort"][0] - state.CommentSort = m["sort"][0] } if len(m["communityname"]) > 0 { state.CommunityName = m["communityname"][0]