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 updating note title when switching to another note
azivner14001f67d87a
diff --git a/public/javascripts/note_editor.js b/public/javascripts/note_editor.jsindex fd801e1c82..c0015843a4 100644--- a/public/javascripts/note_editor.js+++ b/public/javascripts/note_editor.js@@ -89,7 +89,7 @@ const noteEditor = (function() {note.detail.note_title = title;- noteTree.setCurrentNoteTitle(title);+ noteTree.setNoteTitle(note.detail.note_id, title);}async function saveNoteToServer(note) {diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.jsindex 6554e89d79..c52af4a12d 100644--- a/public/javascripts/note_tree.js+++ b/public/javascripts/note_tree.js@@ -381,7 +381,6 @@ const noteTree = (function() {noteEditor.switchToNote(node.note_id);showParentList(node.note_id, data.node);- return false;},expand: (event, data) => {setExpandedToServer(data.node.data.note_tree_id, true);@@ -554,14 +553,10 @@ const noteTree = (function() {return autocompleteItems;}- function setCurrentNoteTitle(title) {- const currentNoteId = getCurrentNoteId();+ function setNoteTitle(noteId, title) {+ noteIdToTitle[noteId] = title;- if (currentNoteId) {- noteIdToTitle[currentNoteId] = title;-- getNodesByNoteId(currentNoteId).map(clone => treeUtils.setNodeTitleWithPrefix(clone));- }+ getNodesByNoteId(noteId).map(clone => treeUtils.setNodeTitleWithPrefix(clone));}async function createNewTopLevelNote() {@@ -634,7 +629,7 @@ const noteTree = (function() {getNoteTitle,setCurrentNotePathToHash,getAutocompleteItems,- setCurrentNoteTitle,+ setNoteTitle,createNewTopLevelNote,createNote,setPrefix,