From 796de02bb9492c155d4d8207727c15a3d76d4d2b Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 13 Jun 2023 19:39:59 -0400 Subject: [PATCH] need to reorder this logic now, seems to work better --- web.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/web.go b/web.go index a76ebfb..410c9e0 100644 --- a/web.go +++ b/web.go @@ -1034,18 +1034,20 @@ func threadsort(honks []*Honk) []*Honk { var nextlevel func(p *Honk) level := 0 nextlevel = func(p *Honk) { + levelup := true + if pp := honkx[p.RID]; pp != nil && p.Honker == pp.Honker { + levelup = false + } else { + ilog.Printf("levelup %s", p.XID) + } + if levelup { + level++ + } if level > 4 { p.Style += fmt.Sprintf(" level%d", 4) } else { p.Style += fmt.Sprintf(" level%d", level) } - levelup := true - if pp := honkx[p.RID]; pp != nil && p.Honker == pp.Honker { - levelup = false - } - if levelup { - level++ - } childs := kids[p.XID] sort.Slice(childs, func(i, j int) bool { return childs[i].Date.Before(childs[j].Date)