commit 2e99e5acaac50c6334e7cceaf8e16f3abdf542c5
parent 0b7a600c6792d8e623c76e75c1a9051b80ec7a41
Author: William Casarin <jb55@jb55.com>
Date: Mon, 2 Jan 2023 17:59:13 -0800
threadv2: Fix threads sometimes not loading on first click
This makes the initial thread open a bit faster
Changelog-Fixed: Fix threads sometimes not loading on first click
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/damus/Views/ThreadV2View.swift b/damus/Views/ThreadV2View.swift
@@ -59,6 +59,13 @@ struct BuildThreadV2View: View {
self.event_id = event_id
}
+ init(damus: DamusState, event: NostrEvent) {
+ self.damus = damus
+ self.event_id = event.id
+ self._current_event = State(initialValue: event)
+ handle_current_events(ev: event)
+ }
+
func unsubscribe_all() {
print("ThreadV2View: Unsubscribe all..")
@@ -242,7 +249,7 @@ struct ThreadV2View: View {
ForEach(thread.parentEvents, id: \.id) { event in
NavigationLink(destination: BuildThreadV2View(
damus: damus,
- event_id: event.id
+ event: event
)){
EventView(
event: event,
@@ -285,7 +292,7 @@ struct ThreadV2View: View {
ForEach(thread.childEvents, id: \.id) { event in
NavigationLink(destination: BuildThreadV2View(
damus: damus,
- event_id: event.id
+ event: event
)){
EventView(
event: event,