feat(client/print): automatically apply right query param

This commit is contained in:
Elian Doran 2025-10-18 22:05:57 +03:00
parent 55fde593a3
commit 750c4104f7
No known key found for this signature in database

View File

@ -51,7 +51,12 @@ export default function PresentationView({ note, noteIds, media }: ViewModeProps
<ButtonOverlay containerRef={containerRef} api={api} />
</>
)
} 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;
}