commit 403fa74f8d5ada2bb658874610ab3285a3aa7065
parent ee32c50fb939ba7ba5a7c3694104ee30ff0dbd31
Author: William Casarin <jb55@jb55.com>
Date: Sat, 30 Apr 2022 12:15:44 -0700
just use stack navigationview
it seems less buggy
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/damus/ContentView.swift b/damus/ContentView.swift
@@ -169,6 +169,7 @@ struct ContentView: View {
}
.navigationBarTitle("Damus", displayMode: .inline)
}
+ .navigationViewStyle(.stack)
}
var body: some View {
diff --git a/damus/Models/ThreadModel.swift b/damus/Models/ThreadModel.swift
@@ -20,11 +20,6 @@ class ThreadModel: ObservableObject {
init(ev: NostrEvent, pool: RelayPool) {
self.event = ev
self.pool = pool
- subscribe()
- }
-
- deinit {
- unsubscribe()
}
func unsubscribe() {
diff --git a/damus/Views/EventActionBar.swift b/damus/Views/EventActionBar.swift
@@ -56,6 +56,7 @@ struct EventActionBar: View {
}
}
+ .contentShape(Rectangle())
}
}
@@ -66,5 +67,6 @@ func EventActionButton(img: String, col: Color?, action: @escaping () -> ()) ->
.font(.footnote)
.foregroundColor(col == nil ? Color.gray : col!)
}
+ .contentShape(Rectangle())
}
diff --git a/damus/Views/ThreadView.swift b/damus/Views/ThreadView.swift
@@ -43,6 +43,12 @@ struct ThreadView: View {
is_chatroom = !is_chatroom
//print("is_chatroom: \(is_chatroom)")
}
+ .onAppear() {
+ thread.subscribe()
+ }
+ .onDisappear() {
+ thread.unsubscribe()
+ }
}
}
diff --git a/damus/Views/TimelineView.swift b/damus/Views/TimelineView.swift
@@ -43,6 +43,7 @@ struct TimelineView: View {
NavigationLink(destination: tv) {
EventView(event: ev, highlight: .none, has_action_bar: true, pool: pool)
}
+ .isDetailLink(true)
.buttonStyle(PlainButtonStyle())
//.onTapGesture {
//NotificationCenter.default.post(name: .open_thread, object: ev)