damus

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

commit 601fa49a6e44d439ef16bb89b9daa5dd0f9d6738
parent 216029410b61e0268a754ae135b5c5f2aa2be2db
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 22 Jun 2023 10:20:57 +0200

nozaps: don't show top zaps or zap replies

We can't associate zaps with notes anymore

Diffstat:
Mdamus/Views/ThreadView.swift | 63++++++++++++++++++++++++++-------------------------------------
1 file changed, 26 insertions(+), 37 deletions(-)

diff --git a/damus/Views/ThreadView.swift b/damus/Views/ThreadView.swift @@ -11,17 +11,8 @@ struct ThreadView: View { let state: DamusState @ObservedObject var thread: ThreadModel - @ObservedObject var zaps: ZapsDataModel - @Environment(\.dismiss) var dismiss - init(state: DamusState, thread: ThreadModel) { - self.state = state - self._thread = ObservedObject(wrappedValue: thread) - let zaps = state.events.get_cache_data(thread.event.id).zaps_model - self._zaps = ObservedObject(wrappedValue: zaps) - } - var parent_events: [NostrEvent] { state.events.parent_events(event: thread.event) } @@ -31,28 +22,26 @@ struct ThreadView: View { } var body: some View { - let top_zap = get_top_zap(events: state.events, evid: thread.event.id) + //let top_zap = get_top_zap(events: state.events, evid: thread.event.id) ScrollViewReader { reader in ScrollView { LazyVStack { // MARK: - Parents events view ForEach(parent_events, id: \.id) { parent_event in - if top_zap?.event?.id != parent_event.id { - - MutedEventView(damus_state: state, - event: parent_event, - selected: false) - .padding(.horizontal) - .onTapGesture { - thread.set_active_event(parent_event) - scroll_to_event(scroller: reader, id: parent_event.id, delay: 0.1, animate: false) - } - Divider() - .padding(.top, 4) - .padding(.leading, 25 * 2) + MutedEventView(damus_state: state, + event: parent_event, + selected: false) + .padding(.horizontal) + .onTapGesture { + thread.set_active_event(parent_event) + scroll_to_event(scroller: reader, id: parent_event.id, delay: 0.1, animate: false) } + Divider() + .padding(.top, 4) + .padding(.leading, 25 * 2) + }.background(GeometryReader { geometry in // get the height and width of the EventView view let eventHeight = geometry.frame(in: .global).height @@ -73,27 +62,27 @@ struct ThreadView: View { ) .id(self.thread.event.id) + /* if let top_zap { ZapEvent(damus: state, zap: top_zap, is_top_zap: true) .padding(.horizontal) } + */ ForEach(child_events, id: \.id) { child_event in - if top_zap?.event?.id != child_event.id { - MutedEventView( - damus_state: state, - event: child_event, - selected: false - ) - .padding(.horizontal) - .onTapGesture { - thread.set_active_event(child_event) - scroll_to_event(scroller: reader, id: child_event.id, delay: 0.1, animate: false) - } - - Divider() - .padding([.top], 4) + MutedEventView( + damus_state: state, + event: child_event, + selected: false + ) + .padding(.horizontal) + .onTapGesture { + thread.set_active_event(child_event) + scroll_to_event(scroller: reader, id: child_event.id, delay: 0.1, animate: false) } + + Divider() + .padding([.top], 4) } } }.navigationBarTitle(NSLocalizedString("Thread", comment: "Navigation bar title for note thread."))