mirror of
https://github.com/zadam/trilium.git
synced 2025-01-26 17:07:56 +08:00
fix updating note title when switching to another note
This commit is contained in:
parent
cd90200272
commit
14001f67d8
2 changed files with 5 additions and 10 deletions
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue