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.
This commit is contained in:
parent
29c9551d30
commit
54c4d9be48
1 changed files with 7 additions and 2 deletions
|
|
@ -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); }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue