jkdsjkdsj
All checks were successful
Test / test (push) Successful in 2s
Build and Deploy Nuxt / build (push) Successful in 50s

This commit is contained in:
2026-10-16 17:53:15 +02:00
parent 3f2ac16394
commit 013c3512fe
3 changed files with 28 additions and 11 deletions

View File

@@ -1432,7 +1432,7 @@ async function applyDragonrollNotePage(page, entry) {
const title = notePageTitle(entry);
const html = notePageHtml(entry.content);
const updates = {};
if (String(page.title?.text ?? page.title ?? "") !== title) updates["title.text"] = title;
if (String(page.name ?? "") !== title) updates.name = title;
if (String(page.text?.content ?? "") !== html) updates["text.content"] = html;
if (!dragonrollNoteId(page)) updates[`flags.${MODULE_ID}.noteId`] = String(entry._id);
if (Object.keys(updates).length) await page.update(updates);
@@ -1440,7 +1440,9 @@ async function applyDragonrollNotePage(page, entry) {
async function createDragonrollNotePage(journal, entry) {
const pages = await journal.createEmbeddedDocuments("JournalEntryPage", [{
title: { text: notePageTitle(entry) },
// A page's display title is its `name`; `title` only holds the table-of-contents
// flags (`show`/`level`). Missing `name` fails the document's validation.
name: notePageTitle(entry),
text: { content: notePageHtml(entry.content) },
flags: { [MODULE_ID]: { noteId: String(entry._id) } },
}], { renderSheet: false });