From d288c1b05228a6ec89b7e04b54a6aa10f3f1d8fc Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 17 Feb 2020 22:47:50 +0100 Subject: [PATCH] small fixes --- src/public/javascripts/widgets/note_paths.js | 6 ++++++ src/public/javascripts/widgets/note_tree.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/public/javascripts/widgets/note_paths.js b/src/public/javascripts/widgets/note_paths.js index 1e89929d5..9016c8e9e 100644 --- a/src/public/javascripts/widgets/note_paths.js +++ b/src/public/javascripts/widgets/note_paths.js @@ -88,4 +88,10 @@ export default class NotePathsWidget extends TabAwareWidget { this.$notePathList.append(noteLink); } + + entitiesReloadedEvent({loadResults}) { + if (loadResults.getBranches().find(branch => branch.noteId === this.noteId)) { + this.refresh(); + } + } } \ No newline at end of file diff --git a/src/public/javascripts/widgets/note_tree.js b/src/public/javascripts/widgets/note_tree.js index eeca1e92d..1192bf680 100644 --- a/src/public/javascripts/widgets/note_tree.js +++ b/src/public/javascripts/widgets/note_tree.js @@ -486,11 +486,11 @@ export default class NoteTreeWidget extends TabAwareWidget { if (!branch.isDeleted) { for (const parentNode of this.getNodesByNoteId(branch.parentNoteId)) { - if (!parentNode.isLoaded()) { + if (parentNode.isFolder() && !parentNode.isLoaded()) { continue; } - const found = parentNode.getChildren().find(child => child.data.noteId === branch.noteId); + const found = (parentNode.getChildren() || []).find(child => child.data.noteId === branch.noteId); if (!found) { noteIdsToReload.add(branch.parentNoteId);