From 416c05ed3bac3d231620f0b298b9533b89887a24 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 19 Nov 2025 08:43:57 +0200 Subject: [PATCH] fix(share): footer navigation doesn't respect #shareHiddenFromTree (closes #7781) --- packages/share-theme/src/templates/prev_next.ejs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/share-theme/src/templates/prev_next.ejs b/packages/share-theme/src/templates/prev_next.ejs index 9bfce70c4..ea93cd336 100644 --- a/packages/share-theme/src/templates/prev_next.ejs +++ b/packages/share-theme/src/templates/prev_next.ejs @@ -5,7 +5,7 @@ if (note.noteId === subRoot.note.noteId) return null; const parent = note.getParentNotes()[0]; - const children = parent.getChildNotes(); + const children = parent.getVisibleChildNotes(); const index = children.findIndex(n => n.noteId === note.noteId); // If we are the first child, previous goes up a level @@ -15,8 +15,8 @@ // We are not the first child at this level so previous // should go to the end of the previous tree let candidate = children[index - 1]; - while (candidate.hasChildren()) { - const children = candidate.getChildNotes(); + while (candidate.hasVisibleChildren()) { + const children = candidate.getVisibleChildNotes(); const lastChild = children[children.length - 1]; candidate = lastChild; } @@ -27,10 +27,10 @@ const nextNote = (() => { // If this currently active note has children, next // should be the first child - if (note.hasChildren()) return note.getChildNotes()[0]; + if (note.hasVisibleChildren()) return note.getVisibleChildNotes()[0]; let parent = note.getParentNotes()[0]; - let children = parent.getChildNotes(); + let children = parent.getVisibleChildNotes(); let index = children.findIndex(n => n.noteId === note.noteId); // If we are not the last of the current level, just go @@ -44,7 +44,7 @@ const originalParent = parent; parent = parent.getParentNotes()[0]; - children = parent.getChildNotes(); + children = parent.getVisibleChildNotes(); index = children.findIndex(n => n.noteId === originalParent.noteId); }