From faaf77d9e552ef53af808af82ac929292f99f786 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Fri, 12 Aug 2022 10:57:00 -0700 Subject: [PATCH] scroll to bottom instead. It's a bit less jarring Signed-off-by: William Casarin --- damus/Components/EndBlock.swift | 2 +- damus/Views/ChatroomView.swift | 2 +- damus/Views/EventDetailView.swift | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/damus/Components/EndBlock.swift b/damus/Components/EndBlock.swift index eb3b566f..16e8c4fb 100644 --- a/damus/Components/EndBlock.swift +++ b/damus/Components/EndBlock.swift @@ -11,7 +11,7 @@ struct EndBlock: View { let height: CGFloat init () { - self.height = 80.0 + self.height = 10.0 } init (height: Float) { diff --git a/damus/Views/ChatroomView.swift b/damus/Views/ChatroomView.swift index efff60d7..673ff9cc 100644 --- a/damus/Views/ChatroomView.swift +++ b/damus/Views/ChatroomView.swift @@ -37,7 +37,7 @@ struct ChatroomView: View { } - EndBlock(height: 500) + EndBlock() } .onReceive(NotificationCenter.default.publisher(for: .select_quote)) { notif in let ev = notif.object as! NostrEvent diff --git a/damus/Views/EventDetailView.swift b/damus/Views/EventDetailView.swift index 18df6481..44c6b9a0 100644 --- a/damus/Views/EventDetailView.swift +++ b/damus/Views/EventDetailView.swift @@ -101,7 +101,7 @@ struct EventDetailView: View { CollapsedEventView(cev, scroller: proxy) } - EndBlock(height: 600) + EndBlock() } .onChange(of: thread.loading) { val in scroll_after_load(proxy) @@ -295,10 +295,10 @@ func scroll_to_event(scroller: ScrollViewProxy, id: String, delay: Double, anima DispatchQueue.main.asyncAfter(deadline: .now() + delay) { if animate { withAnimation { - scroller.scrollTo(id, anchor: .top) + scroller.scrollTo(id, anchor: .bottom) } } else { - scroller.scrollTo(id, anchor: .top) + scroller.scrollTo(id, anchor: .bottom) } } }