Skip to content

Build your personal knowledge base with Trilium Notes

chore(print): clean up some logs

Elian Doran76c337602bbf
diff --git a/apps/client/src/widgets/note_detail.ts b/apps/client/src/widgets/note_detail.ts
index 0ec68060c7..472c4aeea7 100644
--- a/apps/client/src/widgets/note_detail.ts
+++ b/apps/client/src/widgets/note_detail.ts
@@ -302,13 +302,11 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
iframe.className = "print-iframe";
document.body.appendChild(iframe);
iframe.onload = () => {
- console.log("Got ", iframe, iframe.contentWindow);
- if (iframe.contentWindow) {
- iframe.contentWindow.addEventListener("note-ready", () => {
- iframe.contentWindow?.print();
- document.body.removeChild(iframe);
- });
- }
+ if (!iframe.contentWindow) return;
+ iframe.contentWindow.addEventListener("note-ready", () => {
+ iframe.contentWindow?.print();
+ document.body.removeChild(iframe);
+ });
};
}
diff --git a/apps/server/src/routes/index.ts b/apps/server/src/routes/index.ts
index d5183cbbe3..ea4821e3ab 100644
--- a/apps/server/src/routes/index.ts
+++ b/apps/server/src/routes/index.ts
@@ -20,7 +20,6 @@ type View = "desktop" | "mobile" | "print";
function index(req: Request, res: Response) {
const view = getView(req);
- console.log("Got view ", view);
const options = optionService.getOptionMap();
//'overwrite' set to false (default) => the existing token will be re-used and validated
@@ -68,7 +67,6 @@ function index(req: Request, res: Response) {
}
function getView(req: Request): View {
- console.log("Got ", req.query);
// Special override for printing.
if ("print" in req.query) {
return "print";