Skip to content

Build your personal knowledge base with Trilium Notes

chore(script_deployer): refresh all active contexts

Elian Doranae787b8f82a9
diff --git a/apps/script-deployer/src/dev.ts b/apps/script-deployer/src/dev.ts
index 6dae4516f1..694ab238cf 100644
--- a/apps/script-deployer/src/dev.ts
+++ b/apps/script-deployer/src/dev.ts
@@ -263,11 +263,11 @@ function watchScripts() {
ws.sendMessageToAllClients({
type: "execute-script",
script: `function() {
- const note = api.getActiveContextNote();
- console.log("[script-deployer] refresh check:", note?.noteId, "expected:", "${renderNoteId}", "match:", note?.noteId === "${renderNoteId}");
- if (note?.noteId === "${renderNoteId}") {
- api.triggerEvent("refreshData", { ntxId: api.getActiveContext().ntxId });
- console.log("[script-deployer] triggered refreshData for", "${meta.title}");
+ for (const ctx of api.getNoteContexts()) {
+ if (ctx.noteId === "${renderNoteId}") {
+ api.triggerEvent("refreshData", { ntxId: ctx.ntxId });
+ console.log("[script-deployer] refreshed", "${meta.title}", "in context", ctx.ntxId);
+ }
}
}`,
params: [],