Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: implement on demand note search

thecodrrcdbd74035550
diff --git a/packages/core/api/database.js b/packages/core/api/database.js
index a3016e628..baa837c32 100644
--- a/packages/core/api/database.js
+++ b/packages/core/api/database.js
@@ -191,10 +191,11 @@ class Database {
return getItem.call(this, id, KEYS.notes);
}
- searchNotes(query) {
+ searchNotes(query, notes = null) {
if (!query) return [];
+ if (!notes) notes = this.getNotes();
return tfun.filter(v => fuzzysearch(query, v.title + " " + v.content.text))(
- extractValues(this.notes)
+ notes
);
}