Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(script): add warning if trying to render a protected note without the session active
Elian Doran1121ee0133ee
diff --git a/apps/client/src/services/render.tsx b/apps/client/src/services/render.tsxindex 682efa8871..31450b3a82 100644--- a/apps/client/src/services/render.tsx+++ b/apps/client/src/services/render.tsx@@ -18,6 +18,10 @@ async function render(note: FNote, $el: JQuery<HTMLElement>, onError?: ErrorHandfor (const renderNoteId of renderNoteIds) {const bundle = await server.postWithSilentInternalServerError<Bundle>(`script/bundle/${renderNoteId}`);+ if (!bundle) {+ throw new Error(`Script note '${renderNoteId}' could not be loaded. It may be protected and require an active protected session.`);+ }+const $scriptContainer = $("<div>");$el.append($scriptContainer);