Fix the report's transfer rows rendering as text
The report builds its excluded rows as a group per currency -- the transfer legs and, when a tolerance admitted one, the fee -- so its tbody children nest two arrays deep. h flattened only one level, so each group was stringified and the page showed "[object HTMLTableRowElement]" wherever a period held a matched transfer. Children now flatten all the way down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,9 @@ function blankTransfer() {
|
||||
// --- plumbing -------------------------------------------------------------
|
||||
|
||||
// h builds an element. Text always goes in as a text node, never as HTML,
|
||||
// since descriptions come straight off bank statements.
|
||||
// since descriptions come straight off bank statements. Children flatten all
|
||||
// the way down: a map that yields a group of rows — the report's transfers
|
||||
// and their fee — would otherwise be stringified into the page.
|
||||
function h(tag, attrs, ...children) {
|
||||
const el = document.createElement(tag);
|
||||
for (const [k, v] of Object.entries(attrs || {})) {
|
||||
@@ -51,7 +53,7 @@ function h(tag, attrs, ...children) {
|
||||
else if (k === 'value') el.value = v;
|
||||
else el.setAttribute(k, v === true ? '' : v);
|
||||
}
|
||||
for (const c of children.flat()) {
|
||||
for (const c of children.flat(Infinity)) {
|
||||
if (c === null || c === undefined || c === false) continue;
|
||||
el.append(c instanceof Node ? c : document.createTextNode(String(c)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user