only override commentsort on post page. fixes #107

This commit is contained in:
Ryan Stafford 2024-07-20 12:33:59 -04:00
parent 9775db753f
commit 0c9f2df5fd
2 changed files with 3 additions and 1 deletions

View file

@ -630,6 +630,9 @@ func GetPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
Render(w, "block.html", state) Render(w, "block.html", state)
return return
} }
if len(m["sort"]) > 0 {
state.CommentSort = m["sort"][0]
}
state.GetComments() state.GetComments()
Render(w, "index.html", state) Render(w, "index.html", state)
} }

View file

@ -220,7 +220,6 @@ func (state *State) ParseQuery(RawQuery string) {
} }
if len(m["sort"]) > 0 { if len(m["sort"]) > 0 {
state.Sort = m["sort"][0] state.Sort = m["sort"][0]
state.CommentSort = m["sort"][0]
} }
if len(m["communityname"]) > 0 { if len(m["communityname"]) > 0 {
state.CommunityName = m["communityname"][0] state.CommunityName = m["communityname"][0]