damus

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

commit 8954c1c245717193e7012485d632e3eed6e07533
parent 19a421604c4e7b62a4b1a90f942efcccced51f2a
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 20 Feb 2023 13:48:36 -0800

Remove load more popup

Diffstat:
Mdamus/Views/TimelineView.swift | 62+++++++++++++++++++++++++++-----------------------------------
1 file changed, 27 insertions(+), 35 deletions(-)

diff --git a/damus/Views/TimelineView.swift b/damus/Views/TimelineView.swift @@ -41,42 +41,34 @@ struct TimelineView: View { var MainContent: some View { ScrollViewReader { scroller in - ZStack { - VStack { - LoadMoreButton(events: events, scroller: scroller) - .padding([.top], 10) - Spacer() - } - .zIndex(10.0) - - ScrollView { - InnerTimelineView(events: events, damus: damus, show_friend_icon: show_friend_icon, filter: loading ? { _ in true } : filter) - .redacted(reason: loading ? .placeholder : []) - .shimmer(loading) - .disabled(loading) - .background(GeometryReader { proxy -> Color in - DispatchQueue.main.async { - handle_scroll(proxy) - } - return Color.clear - }) - } - .overlay( - Rectangle() - .fill(RECTANGLE_GRADIENT.opacity(realtime_bar_opacity)) - .offset(y: -1) - .frame(height: events.should_queue ? 0 : 8) - , - alignment: .top - ) - .buttonStyle(BorderlessButtonStyle()) - .coordinateSpace(name: "scroll") - .onReceive(NotificationCenter.default.publisher(for: .scroll_to_top)) { _ in - guard let event = events.events.filter(self.filter).first else { - return - } - scroll_to_event(scroller: scroller, id: event.id, delay: 0.0, animate: true, anchor: .top) + ScrollView { + InnerTimelineView(events: events, damus: damus, show_friend_icon: show_friend_icon, filter: loading ? { _ in true } : filter) + .redacted(reason: loading ? .placeholder : []) + .shimmer(loading) + .disabled(loading) + .background(GeometryReader { proxy -> Color in + DispatchQueue.main.async { + handle_scroll(proxy) + } + return Color.clear + }) + } + .overlay( + Rectangle() + .fill(RECTANGLE_GRADIENT.opacity(realtime_bar_opacity)) + .offset(y: -1) + .frame(height: events.should_queue ? 0 : 8) + , + alignment: .top + ) + .buttonStyle(BorderlessButtonStyle()) + .coordinateSpace(name: "scroll") + .onReceive(NotificationCenter.default.publisher(for: .scroll_to_top)) { _ in + guard let event = events.events.filter(self.filter).first else { + return } + events.flush() + scroll_to_event(scroller: scroller, id: event.id, delay: 0.0, animate: true, anchor: .top) } } }