Simpler api endpoints are now integrated into the MainViewModel

This commit is contained in:
Vicnet
2023-11-16 17:53:30 +01:00
parent 3563c23e29
commit 23e1a665df
13 changed files with 284 additions and 74 deletions

View File

@@ -51,11 +51,11 @@ struct RecipeCardView: View {
.clipShape(RoundedRectangle(cornerRadius: 17))
.padding(.horizontal)
.task {
recipeThumb = await viewModel.loadImage(recipeId: recipe.recipe_id, thumb: true)
recipeThumb = await viewModel.getImage(id: recipe.recipe_id, size: .THUMB, needsUpdate: false)//loadImage(recipeId: recipe.recipe_id, thumb: true)
self.isDownloaded = viewModel.recipeDetailExists(recipeId: recipe.recipe_id)
}
.refreshable {
recipeThumb = await viewModel.loadImage(recipeId: recipe.recipe_id, thumb: true, needsUpdate: true)
recipeThumb = await viewModel.getImage(id: recipe.recipe_id, size: .THUMB, needsUpdate: true)//.loadImage(recipeId: recipe.recipe_id, thumb: true, needsUpdate: true)
}
}
}