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
fix(server): note type not changed for webview template (closes #7557)
Elian Doran3ee8e7b755ad
diff --git a/apps/server/src/services/handlers.ts b/apps/server/src/services/handlers.tsindex 52e50cbf3e..f32bf6ddd0 100644--- a/apps/server/src/services/handlers.ts+++ b/apps/server/src/services/handlers.ts@@ -102,7 +102,7 @@ eventService.subscribe(eventService.ENTITY_CREATED, ({ entityName, entity }) =>const content = note.getContent();if (- ["text", "code", "mermaid", "canvas", "relationMap", "mindMap"].includes(note.type) &&+ ["text", "code", "mermaid", "canvas", "relationMap", "mindMap", "webView"].includes(note.type) &&typeof content === "string" &&// if the note has already content we're not going to overwrite it with template's one(!content || content.trim().length === 0) &&diff --git a/apps/server/src/services/utils.ts b/apps/server/src/services/utils.tsindex d8c9087eff..bee14dbba6 100644--- a/apps/server/src/services/utils.ts+++ b/apps/server/src/services/utils.ts@@ -131,7 +131,7 @@ export function getContentDisposition(filename: string) {}// render and book are string note in the sense that they are expected to contain empty string-const STRING_NOTE_TYPES = new Set(["text", "code", "relationMap", "search", "render", "book", "mermaid", "canvas"]);+const STRING_NOTE_TYPES = new Set(["text", "code", "relationMap", "search", "render", "book", "mermaid", "canvas", "webView"]);const STRING_MIME_TYPES = new Set(["application/javascript", "application/x-javascript", "application/json", "application/x-sql", "image/svg+xml"]);export function isStringNote(type: string | undefined, mime: string) {