Show a meal's grams in the history list
Same pattern as weigh-ins: "80 g · note" or just "80 g" when there's no note.
This commit is contained in:
@@ -803,6 +803,9 @@
|
||||
const noteEl = li.querySelector(".note");
|
||||
if (ev.type === "weight" && Number.isFinite(ev.weight)) {
|
||||
noteEl.textContent = ev.note ? `${formatWeight(ev.weight)} · ${ev.note}` : formatWeight(ev.weight);
|
||||
} else if (ev.type === "eat" && Number.isFinite(ev.grams) && ev.grams > 0) {
|
||||
const g = `${Math.round(ev.grams)} g`;
|
||||
noteEl.textContent = ev.note ? `${g} · ${ev.note}` : g;
|
||||
} else {
|
||||
noteEl.textContent = ev.note || "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user