mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 08:44:00 +01:00
Fixes mealie when meal plan is empty (#819)
This commit is contained in:
parent
18360e223f
commit
1ca9a4b0eb
@ -6,9 +6,11 @@
|
||||
<template v-if="item.subtitle">
|
||||
{{ item.subtitle }}
|
||||
</template>
|
||||
<template v-else-if="meal"> Today: {{ meal[0].recipe.name }} </template>
|
||||
<template v-else-if="stats">
|
||||
happily keeping {{ stats.totalRecipes }} recipes organized
|
||||
<template v-else-if="mealtext">
|
||||
{{ mealtext }}
|
||||
</template>
|
||||
<template v-else-if="statsText">
|
||||
{{ statsText }}
|
||||
</template>
|
||||
</p>
|
||||
</template>
|
||||
@ -32,6 +34,20 @@ export default {
|
||||
stats: null,
|
||||
meal: null,
|
||||
}),
|
||||
computed: {
|
||||
mealtext: function () {
|
||||
if (this.meal && this.meal.length > 0) {
|
||||
return `Today: ${this.meal[0].recipe.name}`;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
statsText: function () {
|
||||
if (this.stats) {
|
||||
return `Happily keeping ${this.stats.totalRecipes} recipes organized`;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchStatus();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user