Address Gemini's comment

This commit is contained in:
Wael Nasreddine 2025-12-25 16:26:58 -08:00
parent 7c7797d35a
commit cb016c4307

View File

@ -16,8 +16,13 @@
// should go to the end of the previous tree
let candidate = children[index - 1];
while (candidate?.hasVisibleChildren()) {
const children = candidate.getVisibleChildNotes();
candidate = children[children.length - 1];
const visibleChildren = candidate.getVisibleChildNotes();
if (visibleChildren.length === 0) {
break;
}
candidate = visibleChildren[visibleChildren.length - 1];
}
return candidate ?? null;