fix: return empty array if query is empty

This commit is contained in:
thecodrr
2019-12-03 03:20:01 +05:00
parent 4b9b959fa0
commit 906ca1422c

View File

@@ -83,6 +83,7 @@ class Database {
* @param {string} query the search query
*/
async searchNotes(query) {
if (!query) return [];
//TODO benchmark this and make it faster if necessary
let notes = await this.getNotes();
if (!notes) return;