Skip to content

Build your personal knowledge base with Trilium Notes

fix exporting root note, closes #2346

zadambc8b6284a640
diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.js
index 6b2031ddb8..6ac065c470 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} */