mobile: fix crash in list

This commit is contained in:
Ammar Ahmed
2025-04-28 11:34:10 +05:00
committed by Abdullah Atta
parent f3193ba3bc
commit 2a6db1b06f
2 changed files with 3 additions and 2 deletions

View File

@@ -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(() => {

View File

@@ -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 ||