need to reorder this logic now, seems to work better
This commit is contained in:
parent
67496c1208
commit
796de02bb9
16
web.go
16
web.go
|
@ -1034,18 +1034,20 @@ 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
|
||||||
|
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 {
|
if level > 4 {
|
||||||
p.Style += fmt.Sprintf(" level%d", 4)
|
p.Style += fmt.Sprintf(" level%d", 4)
|
||||||
} else {
|
} else {
|
||||||
p.Style += fmt.Sprintf(" level%d", level)
|
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]
|
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)
|
||||||
|
|
Loading…
Reference in New Issue