commit c24b0afb8fbc3ec2c981d600297c221fe19d0e68
parent a357bbe4a6b389274f72882c96df893fa06c298f
Author: William Casarin <jb55@jb55.com>
Date: Fri, 17 Mar 2023 10:13:00 -0600
Don't show test event by accident
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/damus/ContentView.swift b/damus/ContentView.swift
@@ -78,7 +78,7 @@ struct ContentView: View {
@State var event: NostrEvent? = nil
@State var active_profile: String? = nil
@State var active_search: NostrFilter? = nil
- @State var active_event: NostrEvent = test_event
+ @State var active_event: NostrEvent? = nil
@State var profile_open: Bool = false
@State var thread_open: Bool = false
@State var search_open: Bool = false
@@ -170,9 +170,11 @@ struct ContentView: View {
NavigationLink(destination: MaybeProfileView, isActive: $profile_open) {
EmptyView()
}
- let thread = ThreadModel(event: active_event, damus_state: damus_state!)
- NavigationLink(destination: ThreadView(state: damus_state!, thread: thread), isActive: $thread_open) {
- EmptyView()
+ if let active_event {
+ let thread = ThreadModel(event: active_event, damus_state: damus_state!)
+ NavigationLink(destination: ThreadView(state: damus_state!, thread: thread), isActive: $thread_open) {
+ EmptyView()
+ }
}
NavigationLink(destination: MaybeSearchView, isActive: $search_open) {
EmptyView()