Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: sorting order by datemodified sorting in list perspective

Ilian Sapundshiev703b22ea6a87
diff --git a/src/renderer/perspectives/list/components/MainContainer.tsx b/src/renderer/perspectives/list/components/MainContainer.tsx
index d0f460462..7d75b9882 100644
--- a/src/renderer/perspectives/list/components/MainContainer.tsx
+++ b/src/renderer/perspectives/list/components/MainContainer.tsx
@@ -120,6 +120,10 @@ function ListPerspective(props: Props) {
const handleSortBy = (handleSort) => {
if (sortBy !== handleSort) {
setSortBy(handleSort);
+ // Date-based sort defaults to descending (newest first) on first selection
+ if (handleSort === 'byDateModified') {
+ setOrderBy(false);
+ }
} else {
setOrderBy(!orderBy);
}