Skip to content

Commit 416c05e

Browse files
committed
fix(share): footer navigation doesn't respect #shareHiddenFromTree (closes #7781)
1 parent 623da7e commit 416c05e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/share-theme/src/templates/prev_next.ejs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if (note.noteId === subRoot.note.noteId) return null;
66
77
const parent = note.getParentNotes()[0];
8-
const children = parent.getChildNotes();
8+
const children = parent.getVisibleChildNotes();
99
const index = children.findIndex(n => n.noteId === note.noteId);
1010
1111
// If we are the first child, previous goes up a level
@@ -15,8 +15,8 @@
1515
// We are not the first child at this level so previous
1616
// should go to the end of the previous tree
1717
let candidate = children[index - 1];
18-
while (candidate.hasChildren()) {
19-
const children = candidate.getChildNotes();
18+
while (candidate.hasVisibleChildren()) {
19+
const children = candidate.getVisibleChildNotes();
2020
const lastChild = children[children.length - 1];
2121
candidate = lastChild;
2222
}
@@ -27,10 +27,10 @@
2727
const nextNote = (() => {
2828
// If this currently active note has children, next
2929
// should be the first child
30-
if (note.hasChildren()) return note.getChildNotes()[0];
30+
if (note.hasVisibleChildren()) return note.getVisibleChildNotes()[0];
3131
3232
let parent = note.getParentNotes()[0];
33-
let children = parent.getChildNotes();
33+
let children = parent.getVisibleChildNotes();
3434
let index = children.findIndex(n => n.noteId === note.noteId);
3535
3636
// If we are not the last of the current level, just go
@@ -44,7 +44,7 @@
4444
4545
const originalParent = parent;
4646
parent = parent.getParentNotes()[0];
47-
children = parent.getChildNotes();
47+
children = parent.getVisibleChildNotes();
4848
index = children.findIndex(n => n.noteId === originalParent.noteId);
4949
}
5050

0 commit comments

Comments
 (0)