scroll to bottom instead.
It's a bit less jarring Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -11,7 +11,7 @@ struct EndBlock: View {
|
|||||||
let height: CGFloat
|
let height: CGFloat
|
||||||
|
|
||||||
init () {
|
init () {
|
||||||
self.height = 80.0
|
self.height = 10.0
|
||||||
}
|
}
|
||||||
|
|
||||||
init (height: Float) {
|
init (height: Float) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ struct ChatroomView: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EndBlock(height: 500)
|
EndBlock()
|
||||||
}
|
}
|
||||||
.onReceive(NotificationCenter.default.publisher(for: .select_quote)) { notif in
|
.onReceive(NotificationCenter.default.publisher(for: .select_quote)) { notif in
|
||||||
let ev = notif.object as! NostrEvent
|
let ev = notif.object as! NostrEvent
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ struct EventDetailView: View {
|
|||||||
CollapsedEventView(cev, scroller: proxy)
|
CollapsedEventView(cev, scroller: proxy)
|
||||||
}
|
}
|
||||||
|
|
||||||
EndBlock(height: 600)
|
EndBlock()
|
||||||
}
|
}
|
||||||
.onChange(of: thread.loading) { val in
|
.onChange(of: thread.loading) { val in
|
||||||
scroll_after_load(proxy)
|
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) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
|
||||||
if animate {
|
if animate {
|
||||||
withAnimation {
|
withAnimation {
|
||||||
scroller.scrollTo(id, anchor: .top)
|
scroller.scrollTo(id, anchor: .bottom)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scroller.scrollTo(id, anchor: .top)
|
scroller.scrollTo(id, anchor: .bottom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user