mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix node size in a note map when note has hidden image notes, closes #2965
This commit is contained in:
parent
c2c724aa00
commit
9b4ef6ea5e
@ -10,7 +10,11 @@ function buildDescendantCountMap() {
|
|||||||
if (!(noteId in noteIdToCountMap)) {
|
if (!(noteId in noteIdToCountMap)) {
|
||||||
const note = becca.getNote(noteId);
|
const note = becca.getNote(noteId);
|
||||||
|
|
||||||
noteIdToCountMap[noteId] = note.children.length;
|
const hiddenImageNoteIds = note.getRelations('imageLink').map(rel => rel.value);
|
||||||
|
const childNoteIds = note.children.map(child => child.noteId);
|
||||||
|
const nonHiddenNoteIds = childNoteIds.filter(childNoteId => !hiddenImageNoteIds.includes(childNoteId));
|
||||||
|
|
||||||
|
noteIdToCountMap[noteId] = nonHiddenNoteIds.length;
|
||||||
|
|
||||||
for (const child of note.children) {
|
for (const child of note.children) {
|
||||||
noteIdToCountMap[noteId] += getCount(child.noteId);
|
noteIdToCountMap[noteId] += getCount(child.noteId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user