fix(frontend): proper null check for notes (#1583)

Adds a proper check for the mealplan.recipe property in multiple places to resolve the bug described in #1571. In development the page would fail to render.
This commit is contained in:
Hayden 2022-08-20 11:21:57 -08:00 committed by GitHub
parent aaeb162dd5
commit 74548e9152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -218,7 +218,7 @@
<RecipeCard <RecipeCard
v-for="mealplan in plan.meals" v-for="mealplan in plan.meals"
:key="mealplan.id" :key="mealplan.id"
:recipe-id="mealplan.recipe ? mealplan.recipe.id : null" :recipe-id="mealplan.recipe ? mealplan.recipe.id : ''"
:image-height="125" :image-height="125"
class="mb-2" class="mb-2"
:route="mealplan.recipe ? true : false" :route="mealplan.recipe ? true : false"
@ -236,8 +236,8 @@
{{ mealplan.entryType }} {{ mealplan.entryType }}
</v-chip> </v-chip>
<RecipeContextMenu <RecipeContextMenu
:name="mealplan.recipe.name" :name="mealplan.recipe ? mealplan.recipe.name : mealplan.title"
:recipe-id="mealplan.recipe.id" :recipe-id="mealplan.recipe ? mealplan.recipe.id : ''"
:slug="mealplan.recipe ? mealplan.recipe.slug : ''" :slug="mealplan.recipe ? mealplan.recipe.slug : ''"
:use-items="{ :use-items="{
delete: false, delete: false,