This commit is contained in:
Ted Unangst 2023-06-13 19:48:22 -04:00
parent 796de02bb9
commit 17be6564ee
1 changed files with 2 additions and 8 deletions

10
web.go
View File

@ -1034,20 +1034,14 @@ func threadsort(honks []*Honk) []*Honk {
var nextlevel func(p *Honk) var nextlevel func(p *Honk)
level := 0 level := 0
nextlevel = func(p *Honk) { nextlevel = func(p *Honk) {
levelup := true levelup := level < 4
if pp := honkx[p.RID]; pp != nil && p.Honker == pp.Honker { if pp := honkx[p.RID]; pp != nil && p.Honker == pp.Honker {
levelup = false levelup = false
} else {
ilog.Printf("levelup %s", p.XID)
} }
if levelup { if levelup {
level++ level++
} }
if level > 4 { p.Style += fmt.Sprintf(" level%d", level)
p.Style += fmt.Sprintf(" level%d", 4)
} else {
p.Style += fmt.Sprintf(" level%d", level)
}
childs := kids[p.XID] childs := kids[p.XID]
sort.Slice(childs, func(i, j int) bool { sort.Slice(childs, func(i, j int) bool {
return childs[i].Date.Before(childs[j].Date) return childs[i].Date.Before(childs[j].Date)