add error notification when a RecipeView is clicked without the recipe being found
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

pull/54/head
Maxime BATISTA 2 years ago
parent 563dd0000c
commit 70b1237f2e

@ -20,8 +20,13 @@ public partial class HomePage : ContentPage
{
layout.Children.Add(new RecipeView(info, () =>
{
Recipe recipe = service.GetRecipe(info);
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, 1));
Recipe? recipe = service.GetRecipe(info);
if (recipe != null)
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, 1));
else
{
notifier.Error("Could not find recipe");
}
}));
}

Loading…
Cancel
Save