old style navigation

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-04-30 11:46:56 -07:00
parent a88324333b
commit d574e572d4
13 changed files with 141 additions and 140 deletions

View File

@@ -22,7 +22,7 @@ struct ChatroomView: View {
next_ev: ind == count-1 ? nil : thread.events[ind+1]
)
.onTapGesture {
if thread.event!.id == ev.id {
if thread.event.id == ev.id {
//dismiss()
toggle_thread_view()
} else {
@@ -35,13 +35,13 @@ struct ChatroomView: View {
}
.onReceive(NotificationCenter.default.publisher(for: .select_quote)) { notif in
let ev = notif.object as! NostrEvent
if ev.id != thread.event!.id {
if ev.id != thread.event.id {
thread.set_active_event(ev)
}
scroll_to_event(scroller: scroller, id: ev.id, delay: 0, animate: true, anchor: .top)
}
.onAppear() {
scroll_to_event(scroller: scroller, id: thread.event!.id, delay: 0.3, animate: true, anchor: .bottom)
scroll_to_event(scroller: scroller, id: thread.event.id, delay: 0.3, animate: true, anchor: .bottom)
}
}
}