From 3b145cf219d44de1353d2479f099adb5038e73f0 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 2 Feb 2024 17:33:25 +0100 Subject: [PATCH] fix notes list --- main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 23fe874..5f6a1e4 100644 --- a/main.js +++ b/main.js @@ -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); }); }