all repos — honk @ 27966ec3ca1768d7e690ea0ed5d24386b390ac48

my fork of honk

if no tophid, retain or reset
Ted Unangst tedu@tedunangst.com
Sun, 20 Oct 2019 14:49:49 -0400
commit

27966ec3ca1768d7e690ea0ed5d24386b390ac48

parent

2fd1e75c678f2607b9a2b1a5ba167b2f13b33017

1 files changed, 8 insertions(+), 2 deletions(-)

jump to
M web.goweb.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