Allow reading recipe info from DB

This commit is contained in:
Kirill Kamakin
2022-11-17 22:05:49 +01:00
parent 0679860de0
commit db3458ca2e

View File

@@ -77,11 +77,9 @@ class RecipesListFragment : Fragment(R.layout.fragment_recipes_list) {
private fun onRecipeClicked(recipe: RecipeSummaryEntity) { private fun onRecipeClicked(recipe: RecipeSummaryEntity) {
logger.v { "onRecipeClicked() called with: recipe = $recipe" } logger.v { "onRecipeClicked() called with: recipe = $recipe" }
binding.progress.isVisible = true binding.progress.isVisible = true
viewModel.refreshRecipeInfo(recipe.slug).observe(viewLifecycleOwner) { result -> viewModel.refreshRecipeInfo(recipe.slug).observe(viewLifecycleOwner) {
binding.progress.isVisible = false binding.progress.isVisible = false
if (result.isSuccess && !isNavigatingSomewhere()) { if (!isNavigatingSomewhere()) navigateToRecipeInfo(recipe.remoteId)
navigateToRecipeInfo(recipe.remoteId)
}
} }
} }