From bc8b6284a64037b36ce0210c187191780f549b9f Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 15 Nov 2021 21:23:19 +0100 Subject: [PATCH] fix exporting root note, closes #2346 (cherry picked from commit 20a187fab976d47c4447b8ec3ee952dc3155e441) --- src/becca/entities/branch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.js index 6b2031ddb..6ac065c47 100644 --- a/src/becca/entities/branch.js +++ b/src/becca/entities/branch.js @@ -58,6 +58,9 @@ class Branch extends AbstractEntity { } init() { + this.becca.branches[this.branchId] = this; + this.becca.childParentToBranch[`${this.noteId}-${this.parentNoteId}`] = this; + if (this.branchId === 'root') { return; } @@ -76,9 +79,6 @@ class Branch extends AbstractEntity { if (!parentNote.children.includes(childNote)) { parentNote.children.push(childNote); } - - this.becca.branches[this.branchId] = this; - this.becca.childParentToBranch[`${this.noteId}-${this.parentNoteId}`] = this; } /** @returns {Note} */