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:
@@ -8,7 +8,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TimelineView: View {
|
||||
@EnvironmentObject var navigationCoordinator: NavigationCoordinator
|
||||
@ObservedObject var events: EventHolder
|
||||
@Binding var loading: Bool
|
||||
|
||||
@@ -28,7 +27,6 @@ struct TimelineView: View {
|
||||
.frame(height: 1)
|
||||
|
||||
InnerTimelineView(events: events, damus: damus, filter: loading ? { _ in true } : filter)
|
||||
.environmentObject(navigationCoordinator)
|
||||
.redacted(reason: loading ? .placeholder : [])
|
||||
.shimmer(loading)
|
||||
.disabled(loading)
|
||||
|
||||
Reference in New Issue
Block a user