damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | LICENSE

commit fd4aa2bb3deab874f2785a565a4442506a4aedb2
parent 914520205e40a1d4509ba8872f13c40ed5895c13
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 18 Apr 2022 16:35:28 -0700

simplify collapsed calculation

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/Views/EventDetailView.swift | 9+--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/damus/Views/EventDetailView.swift b/damus/Views/EventDetailView.swift @@ -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)