Skip to content

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

mobile: fix crash when going from trash -> search

Ammar Ahmedcb29d7161988
diff --git a/apps/mobile/app/components/list/index.tsx b/apps/mobile/app/components/list/index.tsx
index 19fd1c570..3933a4b38 100644
--- a/apps/mobile/app/components/list/index.tsx
+++ b/apps/mobile/app/components/list/index.tsx
@@ -73,7 +73,7 @@ export default function List(props: ListProps) {
? "home"
: props.renderedInRoute === "Favorites"
? "favorites"
- : props.renderedInRoute === "Trash"
+ : props.renderedInRoute === "Trash" || props.dataType === "trash"
? "trash"
: `${props.dataType}s`;
diff --git a/apps/mobile/app/components/sheets/sort/index.tsx b/apps/mobile/app/components/sheets/sort/index.tsx
index be6b2674c..b959be06a 100644
--- a/apps/mobile/app/components/sheets/sort/index.tsx
+++ b/apps/mobile/app/components/sheets/sort/index.tsx
@@ -56,7 +56,7 @@ const Sort = ({
db.settings.getGroupOptions(
screen === "Notes"
? "home"
- : screen === "Trash"
+ : screen === "Trash" || type === "trash"
? "trash"
: ((type + "s") as GroupingKey)
)
@@ -65,7 +65,7 @@ const Sort = ({
const groupType =
screen === "Notes"
? "home"
- : screen === "Trash"
+ : screen === "Trash" || type === "trash"
? "trash"
: screen === "Favorites"
? "favorites"