From 2ef0f41612eddc545120c8d2ff8af218738cc332 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 27 Dec 2023 09:44:05 +0500 Subject: [PATCH] web: fix crash when sorting tags --- apps/web/src/components/group-header/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();