simplify collapsed calculation

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-04-18 16:35:28 -07:00
parent 914520205e
commit fd4aa2bb3d

View File

@@ -318,14 +318,7 @@ func calculated_collapsed_events(collapsed: Bool, active: NostrEvent, events: [N
start = 1
}
count += 1
case .main:
if count != 0 {
let c = CollapsedEvents(count: count, start: start, end: i)
acc.append(.collapsed(c))
start = i
count = 0
}
acc.append(.event(ev, .main))
case .main: fallthrough
case .reply:
if count != 0 {
let c = CollapsedEvents(count: count, start: start, end: i)