if no tophid, retain or reset
Ted Unangst tedu@tedunangst.com
Sun, 20 Oct 2019 14:49:49 -0400
1 files changed,
8 insertions(+),
2 deletions(-)
jump to
M
web.go
→
web.go
@@ -767,8 +767,12 @@ w.Header().Set("Cache-Control", "max-age=60")
} reverbolate(userid, honks) templinfo["Honks"] = honks - if templinfo["TopHID"] == nil && len(honks) > 0 { - templinfo["TopHID"] = honks[0].ID + if templinfo["TopHID"] == nil { + if len(honks) > 0 { + templinfo["TopHID"] = honks[0].ID + } else { + templinfo["TopHID"] = 0 + } } err := readviews.Execute(w, "honkpage.html", templinfo) if err != nil {@@ -1674,6 +1678,8 @@ http.NotFound(w, r)
} if len(honks) > 0 { templinfo["TopHID"] = honks[0].ID + } else { + templinfo["TopHID"] = wanted } reverbolate(userid, honks) templinfo["Honks"] = honks