fix notes list

This commit is contained in:
quenousimporte 2024-02-02 17:33:25 +01:00
parent 86c2ff8ff6
commit 3b145cf219
1 changed files with 7 additions and 4 deletions

11
main.js
View File

@ -2343,11 +2343,11 @@ function toggletitle()
function selectnote()
{
return searchinlist(
localdata.map(n =>
Object.values(notesindex).map(item =>
{
return {
text: n.title,
suffix: gettags(n).map(t => tagmark + t)
text: item.title,
suffix: item.header.tags.map(t => tagmark + t)
}
}));
}
@ -2364,7 +2364,10 @@ function searchandloadnote()
{
selectnote().then(selected =>
{
loadnote(selected.text || selected);
var title = selected.text || selected;
var guid = Object.values(notesindex).find(i => i.title == title);
// todo: create a new one if not found
loadnote(guid);
});
}