Skip to content

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

mobile: fix navigating from Monographs to Search screen

Ammar Ahmed3fb07369bb33
diff --git a/apps/mobile/app/screens/notes/index.tsx b/apps/mobile/app/screens/notes/index.tsx
index 99d75a4ee..dac1edd53 100644
--- a/apps/mobile/app/screens/notes/index.tsx
+++ b/apps/mobile/app/screens/notes/index.tsx
@@ -193,11 +193,14 @@ const NotesPage = ({
hasSearch={true}
id={route.name === "Monographs" ? "Monographs" : params?.current?.id}
onSearch={() => {
- if (!item) return;
+ if (route.name !== "Monographs" && !item) return;
+
const selector =
route.name === "Monographs"
? db.monographs.all
- : db.relations.from(item, "note").selector;
+ : item && db.relations.from(item, "note").selector;
+
+ if (!selector) return;
Navigation.push("Search", {
placeholder: strings.searchInRoute(title || route.name),