From 1121ee0133eeaec1735db1cf07d4011197b293f3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 11 Apr 2026 11:15:31 +0300 Subject: [PATCH] feat(script): add warning if trying to render a protected note without the session active --- apps/client/src/services/render.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/client/src/services/render.tsx b/apps/client/src/services/render.tsx index 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, onError?: ErrorHand for (const renderNoteId of renderNoteIds) { const bundle = await server.postWithSilentInternalServerError(`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 = $("
"); $el.append($scriptContainer);