Skip to content

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

fix: notes search casuing crash

thecodrr617c7b04c46c
diff --git a/apps/web/src/stores/search-store.js b/apps/web/src/stores/search-store.js
index be0ae3843..a3f6186ed 100644
--- a/apps/web/src/stores/search-store.js
+++ b/apps/web/src/stores/search-store.js
@@ -14,10 +14,12 @@ function searchStore(set, get) {
state.item = context.item;
});
},
- search: function(query) {
+ search: async function(query) {
const { items, type } = get();
+ const results = await db.lookup[type](items, query);
+ console.log(query, results);
set(state => {
- state.results = db.lookup[type](items, query);
+ state.results = results;
});
}
};
diff --git a/apps/web/src/views/Search.js b/apps/web/src/views/Search.js
index 37a3d38d0..eb42c0402 100644
--- a/apps/web/src/views/Search.js
+++ b/apps/web/src/views/Search.js
@@ -3,7 +3,7 @@ import ListContainer from "../components/list-container";
import SearchInput from "../components/search";
import { useStore } from "../stores/searchstore";
-function Search(props) {
+function Search() {
const results = useStore(store => store.results);
const item = useStore(store => store.item);
return (
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index 5aa138ce7..e65b36c93 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -6905,7 +6905,7 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
"notes-core@git+ssh://[email protected]:thecodrr/notes-core.git":
version "1.2.0"
- resolved "git+ssh://[email protected]:thecodrr/notes-core.git#bebbac0c15c0736be26df80e08cc6e7461314026"
+ resolved "git+ssh://[email protected]:thecodrr/notes-core.git#2030036bee3a9e433a4e1716731052d7e10f18b2"
dependencies:
fast-sort "^2.0.1"
fuzzysearch "^1.0.3"