fix finding single note by label with mixed case

This commit is contained in:
zadam
2021-10-08 22:13:39 +02:00
parent a08690b123
commit 20696aa0ab
5 changed files with 17 additions and 5 deletions

View File

@@ -75,8 +75,14 @@ function getNoteWithLabel(name, value) {
// optimized version (~20 times faster) without using normal search, useful for e.g. finding date notes
const attrs = becca.findAttributes('label', name);
if (value === undefined) {
return attrs[0]?.getNote();
}
value = value?.toLowerCase();
for (const attr of attrs) {
if (attr.value === value) {
if (attr.value.toLowerCase() === value) {
return attr.getNote();
}
}