Skip to content

Commit

Permalink
fix(Active Critters): load critters when opening Active Critters View
Browse files Browse the repository at this point in the history
* Previously, the loading of critters was not triggered, so it displayed
an activity indicators without endlessly
* Fix Dimillian#330
  • Loading branch information
renaudjenny committed Oct 22, 2020
1 parent faf733f commit 8309847
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct ActiveCritterSections: View {
}

struct ActiveCrittersView: View {
@Environment(\.currentDate) private var currentDate
@StateObject private var viewModel = ActiveCrittersViewModel(filterOutInCollection: true)
@State private var selectedTab: ActiveCrittersViewModel.CritterType

Expand Down Expand Up @@ -105,6 +106,9 @@ struct ActiveCrittersView: View {
.tabViewStyle(PageTabViewStyle())
.indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always))
.navigationBarTitle("Active Critters", displayMode: .inline)
.onAppear {
viewModel.updateCritters(for: currentDate)
}
}
}

Expand Down

0 comments on commit 8309847

Please sign in to comment.