fixed offline recipes duplicate encoding

This commit is contained in:
Vicnet
2023-12-14 17:18:52 +01:00
parent a3fc891d0a
commit 222685e05d
3 changed files with 8 additions and 20 deletions

View File

@@ -95,9 +95,6 @@ struct MainView: View {
showLoadingIndicator = true
self.serverConnection = await viewModel.checkServerConnection()
await viewModel.getCategories()
for category in viewModel.categories {
await viewModel.getCategory(named: category.name, fetchMode: .preferLocal)
}
await viewModel.updateAllRecipeDetails()
// Open detail view for default category
@@ -145,6 +142,7 @@ struct MainView: View {
Button {
Task {
showLoadingIndicator = true
UserSettings.shared.lastUpdate = Date.distantPast
await viewModel.getCategories()
for category in viewModel.categories {
await viewModel.getCategory(named: category.name, fetchMode: .preferServer)