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 refreshing notes after import / delete
zadamfcb6a06d68c8
diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.jsindex a52c9c2c63..fa2751a277 100644--- a/src/public/javascripts/services/attributes.js+++ b/src/public/javascripts/services/attributes.js@@ -221,7 +221,7 @@ class Attributes {.prop("title", "Remove this attribute").click(async () => {if (valueAttr.attributeId) {- await server.remove("notes/" + noteId + "/attributes/" + valueAttr.attributeId);+ await server.remove("notes/" + this.ctx.note.noteId + "/attributes/" + valueAttr.attributeId);}$tr.remove();diff --git a/src/public/javascripts/services/branches.js b/src/public/javascripts/services/branches.jsindex 96d7c58ae7..519a04e24b 100644--- a/src/public/javascripts/services/branches.js+++ b/src/public/javascripts/services/branches.js@@ -148,7 +148,7 @@ async function deleteNodes(nodes) {const nextNotePath = await getNextNode(nodes);- const noteIds = Array.from(new Set(nodes.map(node => node.data.noteId)));+ const noteIds = Array.from(new Set(nodes.map(node => node.getParent().data.noteId)));await treeService.reloadNotes(noteIds, nextNotePath);diff --git a/src/public/javascripts/services/import.js b/src/public/javascripts/services/import.jsindex 24e3f83e19..fb394a3384 100644--- a/src/public/javascripts/services/import.js+++ b/src/public/javascripts/services/import.js@@ -63,7 +63,7 @@ ws.subscribeToMessages(async message => {toastService.showPersistent(toast);- await treeService.reloadNotes([message.parentNoteId]);+ await treeService.reloadNotes([message.result.parentNoteId]);if (message.result.importedNoteId) {const node = await treeService.activateNote(message.result.importedNoteId);