diff --git a/src/share/shaca/entities/note.js b/src/share/shaca/entities/note.js index f66ce27fb..ac7377f88 100644 --- a/src/share/shaca/entities/note.js +++ b/src/share/shaca/entities/note.js @@ -58,10 +58,20 @@ class Note extends AbstractEntity { return this.children; } + getVisibleChildNotes() { + console.log(this.children.filter(childNote => !childNote.hasLabel('shareHiddenFromTree'))); + + return this.children.filter(childNote => !childNote.hasLabel('shareHiddenFromTree')); + } + hasChildren() { return this.children && this.children.length > 0; } + hasVisibleChildren() { + return this.children && !!this.children.find(childNote => !childNote.hasLabel('shareHiddenFromTree')); + } + getChildBranches() { return this.children.map(childNote => this.shaca.getBranchFromChildAndParent(childNote.noteId, this.noteId)); } diff --git a/src/views/share/page.ejs b/src/views/share/page.ejs index b7506b853..ed52d218b 100644 --- a/src/views/share/page.ejs +++ b/src/views/share/page.ejs @@ -46,7 +46,7 @@ <% } %> - <% if (note.hasChildren()) { %> + <% if (note.hasVisibleChildren()) { %>