mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix correct number of related attributes
This commit is contained in:
parent
ce57a13002
commit
9ce224d4c5
@ -247,6 +247,12 @@ function getRelatedNotes(req) {
|
||||
|
||||
const allResults = matchingNameAndValue.concat(matchingName);
|
||||
|
||||
const allResultNoteIds = new Set();
|
||||
|
||||
for (const record of allResults) {
|
||||
allResultNoteIds.add(record.noteId);
|
||||
}
|
||||
|
||||
for (const record of allResults) {
|
||||
if (results.length >= 20) {
|
||||
break;
|
||||
@ -260,7 +266,7 @@ function getRelatedNotes(req) {
|
||||
}
|
||||
|
||||
return {
|
||||
count: allResults.length,
|
||||
count: allResultNoteIds.size,
|
||||
results
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user