From 54c4d9be4803e5134aa0a4ae9b1d8d7f769debe1 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 13:57:23 +0000 Subject: [PATCH] A prayer packet printed from the browser includes its evangelical-share page buildPacket takes the flock-wide evangelical share as its sixth argument. The Node generator passed it; the browser print path did not, so the page returned an empty string and a user's packet had one sheet fewer, with nothing to say so. It now loads the same data/people-groups/christian-share.json (about 1 KB, lazily, beside the strings), and a host may supply its own figure through opts.christian like opts.strings. --- library/composables/usePosterPrints.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/library/composables/usePosterPrints.js b/library/composables/usePosterPrints.js index 97cee56ef..d286175e6 100644 --- a/library/composables/usePosterPrints.js +++ b/library/composables/usePosterPrints.js @@ -233,9 +233,14 @@ export function usePosterPrints(opts = {}) { set(item, kind, 'fetch', 'fetching people groups', 30); try { const data = await rows(item); - const [{ createPacketRenderer }, strings] = await Promise.all([ + // `christian` is the flock-wide evangelical share behind the packet's %-evangelical page. The + // Node generator passes it (packet.mjs reads data/people-groups/christian-share.json); this + // path did not, so buildPacket's christianPage returned '' and a browser print had one sheet + // fewer with nothing to say so. Same seam as strings: a host may supply its own figure. + const [{ createPacketRenderer }, strings, christian] = await Promise.all([ import('../packet/packet-render.js'), opts.strings ? opts.strings() : import('../scripts/posters/packet-strings.json').then((m) => m.default || m), + opts.christian ? opts.christian() : import('../../data/people-groups/christian-share.json').then((m) => m.default || m), ]); const R = createPacketRenderer({ strings, lang: lang() }); // Photos stay as URLs. The Node generator base64-inlines them so its file is @@ -245,7 +250,7 @@ export function usePosterPrints(opts = {}) { data.filter((g) => g.image_url).map((g) => [g.slug, g.image_url]), ); set(item, kind, 'render', `printing ${data.length} people groups`, 70); - openPrintFrame(R.buildPacket(item, data, photos, mapSvg, funnel), { autoprint: true }); + openPrintFrame(R.buildPacket(item, data, photos, mapSvg, funnel, christian), { autoprint: true }); done(item, kind); } catch (e) { fail(item, kind, e); } }