nav: remove environmentObjects
environment objects are implicit arguments that cannot be checked by the compiler. They are a common source of crashes. Use a main NavigationCoordinator in DamusState for the core app, and pass in other coordinators in the account setup view for the parts of the app that don't have a DamusState.
This commit is contained in:
@@ -10,7 +10,6 @@ import SwiftUI
|
||||
struct ReactionsView: View {
|
||||
let damus_state: DamusState
|
||||
@StateObject var model: ReactionsModel
|
||||
@EnvironmentObject var navigationCoordinator: NavigationCoordinator
|
||||
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
@@ -19,7 +18,6 @@ struct ReactionsView: View {
|
||||
LazyVStack {
|
||||
ForEach(model.events, id: \.id) { ev in
|
||||
ReactionView(damus_state: damus_state, reaction: ev)
|
||||
.environmentObject(navigationCoordinator)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
|
||||
Reference in New Issue
Block a user