Update cookcli-recipe-strategy.js
This commit is contained in:
parent
3ab65d2a17
commit
cde1e90241
8
dist/cookcli-recipe-strategy.js
vendored
8
dist/cookcli-recipe-strategy.js
vendored
|
|
@ -244,14 +244,12 @@ class CookCliRecipeViewStrategy extends HTMLElement {
|
||||||
const stepIngredients = (step.items || []).filter((item) => item.type === "ingredient");
|
const stepIngredients = (step.items || []).filter((item) => item.type === "ingredient");
|
||||||
if (stepIngredients.length) {
|
if (stepIngredients.length) {
|
||||||
const lines = stepIngredients.map((item) => {
|
const lines = stepIngredients.map((item) => {
|
||||||
const qty = item.quantity
|
const qty = item.quantity ?? ""
|
||||||
? `${item.quantity.value ?? ""} ${item.quantity.unit ?? ""}`.trim()
|
? `${item.quantity.value ?? ""} ${item.quantity.unit ?? ""}`.trim()
|
||||||
: "";
|
: "";
|
||||||
return `- ${qty ? `**${qty}** ` : ""}${item.name}`;
|
return `- ${qty ? `**${qty}** ` : ""}${item.name ?? ""}`;
|
||||||
});
|
});
|
||||||
if (lines.trim() !== "") {
|
leftCards.push({ type: "markdown", content: lines.join("\n") });
|
||||||
leftCards.push({ type: "markdown", content: lines.join("\n") });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.timer_entity) {
|
if (config.timer_entity) {
|
||||||
|
|
|
||||||
Reference in a new issue