From b3718f25aac86bf739e20c67cdca396215bbbb5c Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Fri, 14 Mar 2025 16:15:38 +0500 Subject: [PATCH] mobile: fix crash when clicking sort button in trash --- apps/mobile/app/components/sheets/sort/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app/components/sheets/sort/index.tsx b/apps/mobile/app/components/sheets/sort/index.tsx index 49f275d59..4f241f6f9 100644 --- a/apps/mobile/app/components/sheets/sort/index.tsx +++ b/apps/mobile/app/components/sheets/sort/index.tsx @@ -54,7 +54,11 @@ const Sort = ({ const { colors } = useThemeColors(); const [groupOptions, setGroupOptions] = useState( db.settings.getGroupOptions( - screen === "Notes" ? "home" : ((type + "s") as GroupingKey) + screen === "Notes" + ? "home" + : screen === "Trash" + ? "trash" + : ((type + "s") as GroupingKey) ) ); const updateGroupOptions = async (_groupOptions: GroupOptions) => { @@ -185,7 +189,7 @@ const Sort = ({ ]()} - {groupOptions.sortBy === item ? ( + {groupOptions?.sortBy === item ? (