mobile: fix crash when clicking sort button in trash

This commit is contained in:
Ammar Ahmed
2025-03-14 16:15:38 +05:00
committed by Ammar Ahmed
parent 7abfa8e4ce
commit b3718f25aa

View File

@@ -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 = ({
]()}
</Paragraph>
{groupOptions.sortBy === item ? (
{groupOptions?.sortBy === item ? (
<AppIcon
size={AppFontSize.lg}
name="check"