Browse Source

just use stack navigationview

it seems less buggy

Signed-off-by: William Casarin <jb55@jb55.com>
profiles-everywhere
William Casarin 3 years ago
parent
commit
403fa74f8d
  1. 1
      damus/ContentView.swift
  2. 5
      damus/Models/ThreadModel.swift
  3. 2
      damus/Views/EventActionBar.swift
  4. 6
      damus/Views/ThreadView.swift
  5. 1
      damus/Views/TimelineView.swift

1
damus/ContentView.swift

@ -169,6 +169,7 @@ struct ContentView: View {
}
.navigationBarTitle("Damus", displayMode: .inline)
}
.navigationViewStyle(.stack)
}
var body: some View {

5
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() {

2
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())
}

6
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()
}
}
}

1
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)

Loading…
Cancel
Save