fix(share): footer navigation doesn't respect #shareHiddenFromTree (closes #7781)

This commit is contained in:
Elian Doran 2025-11-19 08:43:57 +02:00
parent 623da7eade
commit 416c05ed3b
No known key found for this signature in database

View File

@ -5,7 +5,7 @@
if (note.noteId === subRoot.note.noteId) return null; if (note.noteId === subRoot.note.noteId) return null;
const parent = note.getParentNotes()[0]; const parent = note.getParentNotes()[0];
const children = parent.getChildNotes(); const children = parent.getVisibleChildNotes();
const index = children.findIndex(n => n.noteId === note.noteId); const index = children.findIndex(n => n.noteId === note.noteId);
// If we are the first child, previous goes up a level // 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 // We are not the first child at this level so previous
// should go to the end of the previous tree // should go to the end of the previous tree
let candidate = children[index - 1]; let candidate = children[index - 1];
while (candidate.hasChildren()) { while (candidate.hasVisibleChildren()) {
const children = candidate.getChildNotes(); const children = candidate.getVisibleChildNotes();
const lastChild = children[children.length - 1]; const lastChild = children[children.length - 1];
candidate = lastChild; candidate = lastChild;
} }
@ -27,10 +27,10 @@
const nextNote = (() => { const nextNote = (() => {
// If this currently active note has children, next // If this currently active note has children, next
// should be the first child // 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 parent = note.getParentNotes()[0];
let children = parent.getChildNotes(); let children = parent.getVisibleChildNotes();
let index = children.findIndex(n => n.noteId === note.noteId); let index = children.findIndex(n => n.noteId === note.noteId);
// If we are not the last of the current level, just go // If we are not the last of the current level, just go
@ -44,7 +44,7 @@
const originalParent = parent; const originalParent = parent;
parent = parent.getParentNotes()[0]; parent = parent.getParentNotes()[0];
children = parent.getChildNotes(); children = parent.getVisibleChildNotes();
index = children.findIndex(n => n.noteId === originalParent.noteId); index = children.findIndex(n => n.noteId === originalParent.noteId);
} }