Skip to content

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

web: fix crash when sorting tags

Abdullah Atta2ef0f41612ed
diff --git a/apps/web/src/components/group-header/index.tsx b/apps/web/src/components/group-header/index.tsx
index dd9d6b2b8..87c77265f 100644
--- a/apps/web/src/components/group-header/index.tsx
+++ b/apps/web/src/components/group-header/index.tsx
@@ -200,7 +200,10 @@ async function changeGroupOptions(
if (options.parentKey === "groupBy") {
if (item.key === "abc") groupOptions.sortBy = "title";
- else groupOptions.sortBy = "dateEdited";
+ else
+ options.groupingKey === "tags" || options.groupingKey === "trash"
+ ? "dateModified"
+ : "dateEdited";
}
await db.settings.setGroupOptions(options.groupingKey, groupOptions);
options.refresh();