Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

feat: search for multiple words (#4362)

RoccoSmit03267d6d37c7
diff --git a/web/src/components/SearchBar.tsx b/web/src/components/SearchBar.tsx
index 39eb0bc55..a3fdb806e 100644
--- a/web/src/components/SearchBar.tsx
+++ b/web/src/components/SearchBar.tsx
@@ -17,10 +17,12 @@ const SearchBar = () => {
if (e.key === "Enter") {
e.preventDefault();
if (queryText !== "") {
- memoFilterStore.removeFilter((f) => f.factor === "contentSearch");
- memoFilterStore.addFilter({
- factor: "contentSearch",
- value: queryText,
+ const words = queryText.split(" ");
+ words.forEach((word) => {
+ memoFilterStore.addFilter({
+ factor: "contentSearch",
+ value: word,
+ });
});
setQueryText("");
}