damus

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

commit b100e9887bbd394a9d30137386baf0210d04d624
parent 1d8ca9486305ac0a10e098310c79289f9d8de9cd
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 19 Apr 2022 12:06:24 -0700

lazy vstack ftw

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

Diffstat:
Mdamus/ContentView.swift | 2+-
Mdamus/Views/EventDetailView.swift | 1-
Mdamus/Views/TimelineView.swift | 18++++++++++--------
3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -443,7 +443,7 @@ func get_metadata_since_time(_ metadata_event: NostrEvent?) -> Int64? { func get_since_time(last_event: NostrEvent?) -> Int64 { if last_event == nil { - return Int64(Date().timeIntervalSince1970) - (24 * 60 * 60 * 1) + return Int64(Date().timeIntervalSince1970) - (24 * 60 * 60 * 3) } return last_event!.created_at - 60 * 10 diff --git a/damus/Views/EventDetailView.swift b/damus/Views/EventDetailView.swift @@ -175,7 +175,6 @@ struct EventDetailView: View { .onAppear() { self.add_event(event) subscribe_to_thread() - } } diff --git a/damus/Views/TimelineView.swift b/damus/Views/TimelineView.swift @@ -15,15 +15,17 @@ struct TimelineView: View { var body: some View { ScrollView { - ForEach(events, id: \.id) { (ev: NostrEvent) in - let evdet = EventDetailView(event: ev, pool: pool) - .navigationBarTitle("Thread") - .padding([.leading, .trailing], 6) - .environmentObject(profiles) - NavigationLink(destination: evdet) { - EventView(event: ev, highlight: .none, has_action_bar: true) + LazyVStack { + ForEach(events, id: \.id) { (ev: NostrEvent) in + let evdet = EventDetailView(event: ev, pool: pool) + .navigationBarTitle("Thread") + .padding([.leading, .trailing], 6) + .environmentObject(profiles) + NavigationLink(destination: evdet) { + EventView(event: ev, highlight: .none, has_action_bar: true) + } + .buttonStyle(PlainButtonStyle()) } - .buttonStyle(PlainButtonStyle()) } } .padding([.leading, .trailing], 6)