diff --git a/routes.go b/routes.go index 644c0ce..875f814 100644 --- a/routes.go +++ b/routes.go @@ -638,6 +638,11 @@ func GetComment(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { } func GetUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { state, err := Initialize(ps.ByName("host"), r) + state.Sort = "New" + m, _ := url.ParseQuery(r.URL.RawQuery) + if len(m["sort"]) > 0 { + state.Sort = m["sort"][0] + } if err != nil { Render(w, "index.html", state) return diff --git a/state.go b/state.go index d828a22..3d86931 100644 --- a/state.go +++ b/state.go @@ -491,6 +491,7 @@ func (state *State) GetUser(username string) { Page: lemmy.NewOptional(int64(state.Page)), Limit: lemmy.NewOptional(int64(limit)), SavedOnly: lemmy.NewOptional(state.Op == "Saved"), + Sort: lemmy.NewOptional(lemmy.SortType(state.Sort)), }) if err != nil { fmt.Println(err) diff --git a/templates/main.html b/templates/main.html index eadb11f..cc87ce0 100644 --- a/templates/main.html +++ b/templates/main.html @@ -99,6 +99,17 @@ {{ end }} {{ end }} {{ end}} + {{ if and .User .Activities }} +
+ {{ end }} {{ range $i, $comment := .Comments }}