Skip to content

Build your personal knowledge base with Trilium Notes

fix refreshing notes after import / delete

zadam5b5ab0b044a2
diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.js
index e021c58b3c..684b5b4218 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.js
index 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.js
index 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);