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
tree fixes
zadam0a896cc19c9f
diff --git a/src/public/app/entities/branch.js b/src/public/app/entities/branch.jsindex 4bcb8b93c5..61ad40897b 100644--- a/src/public/app/entities/branch.js+++ b/src/public/app/entities/branch.js@@ -20,8 +20,6 @@ class Branch {/** @param {boolean} */this.isExpanded = !!row.isExpanded;/** @param {boolean} */- this.isDeleted = !!row.isDeleted;- /** @param {boolean} */this.fromSearchNote = !!row.fromSearchNote;}diff --git a/src/public/app/widgets/note_list.js b/src/public/app/widgets/note_list.jsindex 65fc80694a..cabf5088f7 100644--- a/src/public/app/widgets/note_list.js+++ b/src/public/app/widgets/note_list.js@@ -1,6 +1,5 @@import TabAwareWidget from "./tab_aware_widget.js";import NoteListRenderer from "../services/note_list_renderer.js";-import utils from "../services/utils.js";const TPL = `<div class="note-list-widget">@@ -11,6 +10,10 @@ const TPL = `min-height: 0;overflow: auto;}++ .note-list-widget .note-list {+ padding: 10px;+ }</style><div class="note-list-widget-content">diff --git a/src/routes/api/tree.js b/src/routes/api/tree.jsindex ae70634c11..d039863382 100644--- a/src/routes/api/tree.js+++ b/src/routes/api/tree.js@@ -21,6 +21,12 @@ function getNotesAndBranchesAndAttributes(noteIds) {collectEntityIds(branch.parentNote);}+ for (const childNote of note.children) {+ const childBranch = noteCache.getBranch(childNote.noteId, note.noteId);++ collectedBranchIds.add(childBranch.branchId);+ }+for (const attr of note.ownedAttributes) {collectedAttributeIds.add(attr.attributeId);@@ -51,7 +57,7 @@ function getNotesAndBranchesAndAttributes(noteIds) {isProtected: note.isProtected,type: note.type,mime: note.mime,- isDeleted: note.isDeleted+ isDeleted: false // FIXME});}@@ -106,16 +112,16 @@ function getNotesAndBranchesAndAttributes(noteIds) {function getTree(req) {const subTreeNoteId = req.query.subTreeNoteId || 'root';- const collectedNoteIds = new Set(['root']);+ const collectedNoteIds = new Set([subTreeNoteId]);function collect(parentNote) {- for (const childNote of parentNote.children || []) {+ for (const childNote of parentNote.children) {collectedNoteIds.add(childNote.noteId);const childBranch = noteCache.getBranch(childNote.noteId, parentNote.noteId);if (childBranch.isExpanded) {- collect(childBranch);+ collect(childBranch.childNote);}}}diff --git a/src/services/note_cache/entities/attribute.js b/src/services/note_cache/entities/attribute.jsindex 769e33c8ad..5da56160f1 100644--- a/src/services/note_cache/entities/attribute.js+++ b/src/services/note_cache/entities/attribute.js@@ -22,7 +22,7 @@ class Attribute {}/** @param {string} */- this.value = row.type === 'label' ? row.value.toLowerCase() : row.value;+ this.value = row.value;/** @param {boolean} */this.isInheritable = !!row.isInheritable;