From 4e65bbb7bf52b34182c3802e5501e1c41892fac5 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Mon, 28 Apr 2025 11:34:10 +0500 Subject: [PATCH] mobile: fix crash in list --- apps/mobile/app/components/sheets/sort/index.tsx | 3 ++- apps/mobile/app/hooks/use-group-options.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app/components/sheets/sort/index.tsx b/apps/mobile/app/components/sheets/sort/index.tsx index 08200d49e..be6b2674c 100644 --- a/apps/mobile/app/components/sheets/sort/index.tsx +++ b/apps/mobile/app/components/sheets/sort/index.tsx @@ -67,8 +67,9 @@ const Sort = ({ ? "home" : screen === "Trash" ? "trash" + : screen === "Favorites" + ? "favorites" : ((type + "s") as GroupingKey); - console.log("updateGroupOptions for group", groupType, "in", screen); await db.settings.setGroupOptions(groupType, _groupOptions); setGroupOptions(_groupOptions); setTimeout(() => { diff --git a/apps/mobile/app/hooks/use-group-options.ts b/apps/mobile/app/hooks/use-group-options.ts index e6ad2f8f2..1032bfb31 100644 --- a/apps/mobile/app/hooks/use-group-options.ts +++ b/apps/mobile/app/hooks/use-group-options.ts @@ -32,7 +32,7 @@ export function useGroupOptions(type: any) { const onUpdate = (groupType: string) => { if (groupType !== type) return; const options = db.settings?.getGroupOptions(type) as any; - + if (!options) return; if ( groupOptions?.groupBy !== options.groupBy || groupOptions?.sortBy !== options.sortBy ||