From 750c4104f7b545d2910356175ed50cf644c78515 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Oct 2025 22:05:57 +0300 Subject: [PATCH] feat(client/print): automatically apply right query param --- apps/client/src/widgets/collections/presentation/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/collections/presentation/index.tsx b/apps/client/src/widgets/collections/presentation/index.tsx index 297b7f0e5..82d0a47cd 100644 --- a/apps/client/src/widgets/collections/presentation/index.tsx +++ b/apps/client/src/widgets/collections/presentation/index.tsx @@ -51,7 +51,12 @@ export default function PresentationView({ note, noteIds, media }: ViewModeProps ) - } else { + } else if (media === "print") { + // Printing needs a query parameter that is read by Reveal.js. + const url = new URL(window.location.href); + url.searchParams.set("print-pdf", ""); + window.history.replaceState({}, '', url); + // Shadow DOM doesn't work well with Reveal.js's PDF printing mechanism. return content; }