mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: fix archived notes showing in search results (#8216)
* web: fix archived notes showing in search results Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com> * core: make notes param required in lookup.notesWithHighlighting Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -67,8 +67,8 @@ export const Search = ({ route, navigation }: NavigationProps<"Search">) => {
|
||||
case "note":
|
||||
results = await db.lookup.notesWithHighlighting(
|
||||
query,
|
||||
groupOptions,
|
||||
route.params.items as FilteredSelector<Note>
|
||||
route.params.items as FilteredSelector<Note>,
|
||||
groupOptions
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
@@ -36,7 +36,11 @@ function Home() {
|
||||
"notes",
|
||||
async (query, sortOptions) => {
|
||||
if (useStore.getState().context) return;
|
||||
return await db.lookup.notesWithHighlighting(query, sortOptions);
|
||||
return await db.lookup.notesWithHighlighting(
|
||||
query,
|
||||
db.notes.all,
|
||||
sortOptions
|
||||
);
|
||||
},
|
||||
[notes]
|
||||
);
|
||||
|
||||
@@ -47,7 +47,7 @@ function Notes(props: NotesProps) {
|
||||
async (query, sortOptions) => {
|
||||
if (!context || !contextNotes) return;
|
||||
const notes = notesFromContext(context);
|
||||
return await db.lookup.notesWithHighlighting(query, sortOptions, notes);
|
||||
return await db.lookup.notesWithHighlighting(query, notes, sortOptions);
|
||||
},
|
||||
[context, contextNotes]
|
||||
);
|
||||
|
||||
@@ -106,8 +106,8 @@ export default class Lookup {
|
||||
|
||||
async notesWithHighlighting(
|
||||
query: string,
|
||||
sortOptions?: SortOptions,
|
||||
notes?: FilteredSelector<Note>
|
||||
notes: FilteredSelector<Note>,
|
||||
sortOptions?: SortOptions
|
||||
): Promise<VirtualizedGrouping<HighlightedResult>> {
|
||||
const db = this.db.sql() as unknown as Kysely<RawDatabaseSchema>;
|
||||
const excludedIds = this.db.trash.cache.notes;
|
||||
|
||||
Reference in New Issue
Block a user