A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: fix archived notes showing in search results (#8216)
01zulfi0abbd41ff28a
diff --git a/apps/mobile/app/screens/search/index.tsx b/apps/mobile/app/screens/search/index.tsxindex a6688c8ad..b973c2531 100644--- a/apps/mobile/app/screens/search/index.tsx+++ b/apps/mobile/app/screens/search/index.tsx@@ -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;diff --git a/apps/web/src/views/all-notes.tsx b/apps/web/src/views/all-notes.tsxindex 75eca864c..ca96edf14 100644--- a/apps/web/src/views/all-notes.tsx+++ b/apps/web/src/views/all-notes.tsx@@ -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]);diff --git a/apps/web/src/views/notes.tsx b/apps/web/src/views/notes.tsxindex 71fa016a5..b97a2681f 100644--- a/apps/web/src/views/notes.tsx+++ b/apps/web/src/views/notes.tsx@@ -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]);diff --git a/packages/core/src/api/lookup.ts b/packages/core/src/api/lookup.tsindex 9eb79d41f..7f5826a59 100644--- a/packages/core/src/api/lookup.ts+++ b/packages/core/src/api/lookup.ts@@ -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;