From 830984723445b6f0ac5bfb3ab301b5374994efa1 Mon Sep 17 00:00:00 2001 From: Renaud Jenny Date: Thu, 22 Oct 2020 18:36:32 +0100 Subject: [PATCH] fix(Active Critters): load critters when opening Active Critters View * Previously, the loading of critters was not triggered, so it displayed an activity indicators without endlessly * Fix #330 --- .../ACHNBrowserUI/views/critters/ActiveCrittersView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ACHNBrowserUI/ACHNBrowserUI/views/critters/ActiveCrittersView.swift b/ACHNBrowserUI/ACHNBrowserUI/views/critters/ActiveCrittersView.swift index 1b86a30c..fc4dfc82 100644 --- a/ACHNBrowserUI/ACHNBrowserUI/views/critters/ActiveCrittersView.swift +++ b/ACHNBrowserUI/ACHNBrowserUI/views/critters/ActiveCrittersView.swift @@ -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 @@ -105,6 +106,9 @@ struct ActiveCrittersView: View { .tabViewStyle(PageTabViewStyle()) .indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always)) .navigationBarTitle("Active Critters", displayMode: .inline) + .onAppear { + viewModel.updateCritters(for: currentDate) + } } }