expose root node, fixes #101

This commit is contained in:
azivner
2018-05-26 16:16:34 -04:00
parent 874593a167
commit ab0486aaf1
7 changed files with 247 additions and 146 deletions

View File

@@ -58,6 +58,10 @@ class TreeCache {
/** @return NoteShort */
async getNote(noteId) {
if (noteId === 'none') {
return null;
}
return (await this.getNotes([noteId]))[0];
}
@@ -68,6 +72,10 @@ class TreeCache {
}
addBranchRelationship(branchId, childNoteId, parentNoteId) {
if (parentNoteId === 'none') { // applies only to root element
return;
}
this.childParentToBranch[childNoteId + '-' + parentNoteId] = branchId;
this.parents[childNoteId] = this.parents[childNoteId] || [];