mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
web: fix notes search in tags, favorites etc
This commit is contained in:
@@ -168,7 +168,7 @@ class NoteStore extends BaseStore<NoteStore> {
|
||||
const [useStore, store] = createStore(NoteStore);
|
||||
export { useStore, store };
|
||||
|
||||
function notesFromContext(context: Context) {
|
||||
export function notesFromContext(context: Context) {
|
||||
switch (context.type) {
|
||||
case "notebook":
|
||||
case "tag":
|
||||
|
||||
@@ -19,7 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import { useEffect } from "react";
|
||||
import ListContainer from "../components/list-container";
|
||||
import { useStore as useNotesStore } from "../stores/note-store";
|
||||
import {
|
||||
notesFromContext,
|
||||
useStore as useNotesStore
|
||||
} from "../stores/note-store";
|
||||
import { hashNavigate, navigate } from "../navigation";
|
||||
import Placeholder from "../components/placeholders";
|
||||
import { useSearch } from "../hooks/use-search";
|
||||
@@ -35,7 +38,8 @@ function Notes() {
|
||||
"notes",
|
||||
(query) => {
|
||||
if (!context || !contextNotes) return;
|
||||
return db.lookup.notes(query, contextNotes.ungrouped).sorted();
|
||||
const notes = notesFromContext(context);
|
||||
return db.lookup.notes(query, notes).sorted();
|
||||
},
|
||||
[context, contextNotes]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user