damus

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

commit aaa21bf1bfbf8c06ae22c89f50af3a133045a244
parent ba03be5b91f0b8725411ee2d7c167028ab359384
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  2 Jan 2023 18:57:51 -0800

misc refactors

Diffstat:
Mdamus/Models/ThreadModel.swift | 2+-
Mdamus/Views/EventView.swift | 11++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/damus/Models/ThreadModel.swift b/damus/Models/ThreadModel.swift @@ -115,7 +115,7 @@ class ThreadModel: ObservableObject { ref_events.referenced_ids = ev.referenced_ids.map { $0.ref_id } ref_events.referenced_ids?.append(ev.id) ref_events.limit = 50 - events_filter.ids = ref_events.referenced_ids! + events_filter.ids = ref_events.referenced_ids ?? [] events_filter.limit = 100 events_filter.ids?.append(ev.id) case .event_id(let evid): diff --git a/damus/Views/EventView.swift b/damus/Views/EventView.swift @@ -103,12 +103,13 @@ struct BuilderEventView: View { var body: some View { VStack { - if event == nil { - ProgressView().padding() - } else { - NavigationLink(destination: BuildThreadV2View(damus: damus, event_id: event!.id)) { - EventView(damus: damus, event: event!, show_friend_icon: true, size: .small) + if let event = event { + let ev = event.inner_event ?? event + NavigationLink(destination: BuildThreadV2View(damus: damus, event_id: ev.id)) { + EventView(damus: damus, event: event, show_friend_icon: true, size: .small) }.buttonStyle(.plain) + } else { + ProgressView().padding() } } .frame(minWidth: 0, maxWidth: .infinity)