From fcb6a06d68c89bc3425493c44c77d100cd518edb Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 3 Nov 2019 18:33:43 +0100 Subject: [PATCH] fix refreshing notes after import / delete (cherry picked from commit 5b5ab0b044a243b452ee06a78bf33db13281d9d7) --- src/public/javascripts/services/attributes.js | 2 +- src/public/javascripts/services/branches.js | 2 +- src/public/javascripts/services/import.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.js index a52c9c2c6..fa2751a27 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 96d7c58ae..519a04e24 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 24e3f83e1..fb394a338 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);